Skip to content

Commit

Permalink
build: multi-platform docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangt2333 committed Oct 22, 2022
1 parent 13cd4ed commit f6d0abf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@ jobs:
./gradlew build --scan
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

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

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: registry.cn-beijing.aliyuncs.com
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: action.Dockerfile
platforms: linux/amd64 #,linux/arm64
platforms: linux/amd64,linux/arm64
push: true
tags: registry.cn-beijing.aliyuncs.com/sduoj/sduoj-judger:latest
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ ENV LANG C.UTF-8
COPY docker/sources.list /etc/apt/sources.list
COPY docker/testlib /testlib.h

ADD https://github.com/SDUOJ/docker-compose-wait/releases/download/2.7.3/wait /wait
RUN mkdir -p /sduoj/dockerWorkspace \
&& chmod +x /wait
# download docker-compose-wait
COPY --from=sduoj/docker-compose-wait:latest /wait /wait

RUN mkdir -p /sduoj/dockerWorkspace

# install JDKs
ENV JAVA_HOME=/opt/java/openjdk
Expand Down
5 changes: 2 additions & 3 deletions action.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ COPY sduoj-judger-service/build/libs/ /sduoj/
# COPY docker/sources.list /etc/apt/sources.list
COPY docker/testlib /testlib.h

ADD https://github.com/SDUOJ/docker-compose-wait/releases/download/2.7.3/wait /wait
RUN mkdir -p /sduoj/dockerWorkspace \
&& chmod +x /wait
# download docker-compose-wait
COPY --from=sduoj/docker-compose-wait:latest /wait /wait

# install JDKs
ENV JAVA_HOME=/opt/java/openjdk
Expand Down

0 comments on commit f6d0abf

Please sign in to comment.