Skip to content

Commit

Permalink
build: attempt to create both adm64 and arm64 docker files
Browse files Browse the repository at this point in the history
Switched from RedHat to Azul JDK images.
  • Loading branch information
novoj committed Dec 26, 2023
1 parent d65a547 commit 704c55b
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions .github/workflows/docker-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,34 @@ jobs:
workflow_conclusion: success
name: evita-server.jar

- name: Build the Docker image # now build the Docker image, login to DockerHub and push it, then clean everything
- name: Set up QEMU
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
uses: docker/setup-qemu-action@v3

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

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ vars.CI_REGISTRY_USER }}
password: ${{ secrets.CI_REGISTRY_PASSWORD }}

- name: Build and push Docker image
env:
BUILD_ROOT: docker
CI_REGISTRY: ${{vars.CI_REGISTRY}}
CI_REGISTRY_IMAGE: ${{vars.CI_REGISTRY_IMAGE}}
RELEASE_IMAGE: "evitadb:latest"
CI_REGISTRY_USER: ${{vars.CI_REGISTRY_USER}}
CI_REGISTRY_PASSWORD: ${{secrets.CI_REGISTRY_PASSWORD}}
EVITA_JAR_NAME: evita-server.jar
run: |
echo "Evita JAR name: $EVITA_JAR_NAME"
echo "Build root: $BUILD_ROOT"
mv -v "$EVITA_JAR_NAME" "$BUILD_ROOT/$EVITA_JAR_NAME"
ls -la $BUILD_ROOT
$BUILD_ROOT/build.sh
echo "$CI_REGISTRY_PASSWORD" | docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" --password-stdin
echo "Pushing image: $CI_REGISTRY_IMAGE/$CI_REGISTRY_USER/$RELEASE_IMAGE"
docker push "$CI_REGISTRY_IMAGE/$CI_REGISTRY_USER/$RELEASE_IMAGE"
docker logout "$CI_REGISTRY"
echo "Cleaning"
docker rmi "$CI_REGISTRY_USER/$RELEASE_IMAGE"
uses: docker/build-push-action@v3
with:
context: ./docker
file: ./docker/Dockerfile
pull: true
push: true
tags: ${{ vars.CI_REGISTRY_USER }}/${{ env.RELEASE_IMAGE }}
platforms: linux/amd64,linux/arm64/v8
build-args: |
EVITA_JAR_NAME=${{ env.EVITA_JAR_NAME }}

0 comments on commit 704c55b

Please sign in to comment.