Skip to content

Commit

Permalink
Build Docker images for arm64
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Di Fabio <[email protected]>
  • Loading branch information
fab-10 committed May 2, 2024
1 parent a5a3eb8 commit 5ce06cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,26 @@ jobs:
CLOUDSMITH_USER: ${{ secrets.CLOUDSMITH_USER }}
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}

- name: Set up QEMU for Docker
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Check Dockerfile syntax
run: |
docker run --rm -i hadolint/hadolint < docker/Dockerfile
- name: Build Docker Image
run: |
./gradlew dockerDist
- name: Login to Docker Hub for self hosted
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER_RW }}
password: ${{ secrets.DOCKER_PAT_RW }}

- name: Publish Docker Image
- name: Build and Publish Docker Image
run: |
./gradlew dockerUpload
./gradlew -Pdocker-platform=linux/amd64,linux/arm64 distDocker
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ task distDocker {
def gitDetails = getGitCommitDetails(7)
executable shell
workingDir dockerBuildDir
args "-c", "docker build ${dockerPlatform} --build-arg BUILD_DATE=${buildTime()} --build-arg VERSION=${dockerBuildVersion} --build-arg VCS_REF=${gitDetails.hash} -t ${image} ."
args "-c", "docker buildx build ${dockerPlatform} --build-arg BUILD_DATE=${buildTime()} --build-arg VERSION=${dockerBuildVersion} --build-arg VCS_REF=${gitDetails.hash} -t ${image} --push ."
}
}
}
Expand Down

0 comments on commit 5ce06cf

Please sign in to comment.