Skip to content

Commit

Permalink
Fix the problem of OOM while buiding multi-platform Docker image
Browse files Browse the repository at this point in the history
Signed-off-by: John Niang <johnniang@foxmail.com>
  • Loading branch information
JohnNiang committed Nov 24, 2023
1 parent 57a1f2e commit 31e27c8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
39 changes: 20 additions & 19 deletions .github/workflows/halo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:

jobs:
check:
if: ${{ false }}
runs-on: ubuntu-latest
# Default steps
steps:
Expand Down Expand Up @@ -63,11 +64,11 @@ jobs:
run: make -C console check
docker-build-and-push:
runs-on: ubuntu-latest
needs: check
# needs: check
steps:
- uses: actions/checkout@v3
- uses: halo-sigs/actions/halo-next-docker-build@main # change the version to specific ref or release tag while the action is stable.
if: github.event_name != 'pull_request'
# if: github.event_name != 'pull_request'
with:
image-name: ${{ github.event_name == 'release' && 'halo' || 'halo-dev' }}
ghcr-token: ${{ secrets.GHCR_TOKEN }}
Expand All @@ -76,20 +77,20 @@ jobs:
push: ${{ github.event_name == 'push' || github.event_name == 'release' }} # we only push to GHCR if the push is to the next branch
console-ref: ${{ github.event_name == 'release' && github.ref || 'main' }}
platforms: linux/amd64,linux/arm64/v8,linux/ppc64le,linux/s390x
- uses: halo-sigs/actions/halo-next-docker-build@main
if: github.event_name == 'pull_request'
with:
image-name: halo-dev
push: false
console-ref: false
load: true
platforms: ""
- name: E2E Testing
if: github.event_name == 'pull_request'
run: |
sudo curl -L https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod u+x /usr/local/bin/docker-compose
repo=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
docker tag ghcr.io/${repo}/halo-dev:pr-${{ github.event.number }} ghcr.io/halo-dev/halo-dev:dev
cd e2e && ./start.sh
# - uses: halo-sigs/actions/halo-next-docker-build@main
# if: github.event_name == 'pull_request'
# with:
# image-name: halo-dev
# push: false
# console-ref: false
# load: true
# platforms: ""
# - name: E2E Testing
# if: github.event_name == 'pull_request'
# run: |
# sudo curl -L https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
# sudo chmod u+x /usr/local/bin/docker-compose
#
# repo=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
# docker tag ghcr.io/${repo}/halo-dev:pr-${{ github.event.number }} ghcr.io/halo-dev/halo-dev:dev
# cd e2e && ./start.sh
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ibm-semeru-runtimes:open-17-jre as builder
FROM eclipse-temurin:17-jre as builder

# Fix multiplatform build memory issues
# https://github.com/docker/build-push-action/issues/621#issuecomment-1383624173
Expand Down

0 comments on commit 31e27c8

Please sign in to comment.