Skip to content

Commit

Permalink
chaning the JPerf paramter to the builder, not the dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
chargio committed Nov 15, 2024
1 parent df405c5 commit 259a59f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 138 deletions.
79 changes: 39 additions & 40 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,53 @@ name: Docker Image CI

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository}}


jobs:

build-and-push-images:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

# https://docs.docker.com/build/ci/github-actions/multi-platform/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY}}
username: ${{ github.actor }}
password: ${{ github.token }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push the Docker image
uses: docker/build-push-action@v6
with:
# platforms: linux/amd64,linux/arm64
platforms: linux/arm64
push: true
tags: ghcr.io/${{ env.IMAGE_NAME }}:${{ github.sha }},ghcr.io/${{ env.IMAGE_NAME }}:latest
file: ./Dockerfile
labels: ${{ steps.meta.outputs.labels }}
- name: Checkout repository
uses: actions/checkout@v4

# https://docs.docker.com/build/ci/github-actions/multi-platform/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY}}
username: ${{ github.actor }}
password: ${{ github.token }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push the Docker image
uses: docker/build-push-action@v6
with:
# platforms: linux/amd64,linux/arm64
platforms: linux/arm64
push: true
tags: ghcr.io/${{ env.IMAGE_NAME }}:${{ github.sha }},ghcr.io/${{ env.IMAGE_NAME }}:latest
file: ./Dockerfile
labels: ${{ steps.meta.outputs.labels }}
env:
ERL_FLAGS: "+JMsingle true"
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ RUN mix local.hex --force && \
# set build ENV
ENV MIX_ENV="prod"
# Add JPperf as workaround for the failure on building the code in Github actions
ENV ERL_FLAGS="+JPperf true"
# It should not be necessary with QEMU 8.1, and it introduces some security issues, so delete as as soon as possible
# ENV ERL_FLAGS="+JMsingle true"

# install mix dependencies
COPY mix.exs mix.lock ./
Expand Down
97 changes: 0 additions & 97 deletions Dockerfile.old

This file was deleted.

0 comments on commit 259a59f

Please sign in to comment.