Skip to content

Commit

Permalink
Add ARM64 platform (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmirgaleev authored Mar 14, 2023
1 parent 83e432f commit 2eebee6
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 18 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/dockerhub-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,38 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push TzKT Sync image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
file: Tzkt.Sync/Dockerfile
push: true
tags: bakingbad/tzkt-sync:${{ env.RELEASE_VERSION }}


- name: Build and push TzKT API image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
file: Tzkt.Api/Dockerfile
push: true
tags: bakingbad/tzkt-api:${{ env.RELEASE_VERSION }}
16 changes: 12 additions & 4 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,32 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push TzKT Sync image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
file: Tzkt.Sync/Dockerfile
push: true
tags: bakingbad/tzkt-sync:latest

- name: Build and push TzKT API image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
file: Tzkt.Api/Dockerfile
push: true
tags: bakingbad/tzkt-api:latest
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
DOCKER_IMAGE_BASE: ${{ github.repository }}
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Log in to the registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -40,7 +40,7 @@ jobs:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}-api

- name: API image build & push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: Tzkt.Api/Dockerfile
Expand All @@ -59,7 +59,7 @@ jobs:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}-sync

- name: Sync image build & push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: Tzkt.Sync/Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions Tzkt.Api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /app
COPY . .
RUN cd Tzkt.Api && dotnet publish -o output

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
ENV ASPNETCORE_URLS=http://+:5000
RUN groupadd --gid 1000 tzkt \
&& useradd --gid tzkt --no-create-home --uid 1000 tzkt
Expand Down
4 changes: 2 additions & 2 deletions Tzkt.Sync/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /app
COPY . .
RUN cd Tzkt.Sync && dotnet publish -o output

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
RUN groupadd --gid 1000 tzkt \
&& useradd --gid tzkt --no-create-home --uid 1000 tzkt
WORKDIR /app
Expand Down

0 comments on commit 2eebee6

Please sign in to comment.