Skip to content

Commit 58cd1eb

Browse files
committed
feat: support building multi-platform images
1 parent b7eb61d commit 58cd1eb

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/docker-image.yml renamed to .github/workflows/build-docker-image.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99

1010
build:
1111
runs-on: ubuntu-latest
12-
13-
strategy:
14-
matrix:
15-
goos: [linux]
16-
goarch: [amd64, arm64]
1712
steps:
18-
- uses: actions/checkout@v3
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
- name: Set up QEMU
16+
uses: docker/setup-qemu-action@v2
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v2
1919
- name: Docker Login
2020
env:
2121
DOCKER_USER: ${{ secrets.DOCKER_USER }}
@@ -27,6 +27,11 @@ jobs:
2727
run: |
2828
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
2929
- name: Build the Docker image
30-
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USER }}/http-proxy:$GITHUB_REF_NAME
30+
run: docker buildx build \
31+
--platform=linux/arm64,linux/amd64 \
32+
--tag ${{ secrets.DOCKER_USER }}/http-proxy:$GITHUB_REF_NAME \
33+
--file Dockerfile \
34+
--push .
35+
3136
- name: Docker Push
3237
run: docker push ${{ secrets.DOCKER_USER }}/http-proxy:$GITHUB_REF_NAME

0 commit comments

Comments
 (0)