From c4d330947d5e4ab5c36c160e09dd5ba4f58a0353 Mon Sep 17 00:00:00 2001 From: Zhang Minghan Date: Thu, 25 Jan 2024 13:58:50 +0800 Subject: [PATCH] feat: update docker-ci workflow - arm64 support --- .github/workflows/docker-ci.yaml | 14 ++++++++++---- Dockerfile | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-ci.yaml b/.github/workflows/docker-ci.yaml index 5969c12..03d2ec8 100644 --- a/.github/workflows/docker-ci.yaml +++ b/.github/workflows/docker-ci.yaml @@ -19,8 +19,14 @@ jobs: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - name: Build the Docker image - run: docker build . --file Dockerfile --tag programzmh/chatnio:latest + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 - - name: Push to DockerHub - run: docker push programzmh/chatnio:latest + - name: Build and push Docker images + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: programzmh/chatnio:latest diff --git a/Dockerfile b/Dockerfile index 94b301f..cdbc196 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ COPY . . # Set go proxy to https://goproxy.cn (open for vps in China Mainland) # RUN go env -w GOPROXY=https://goproxy.cn,direct -ENV GOOS=linux GOARCH=amd64 GO111MODULE=on CGO_ENABLED=1 +ENV GOOS=linux GO111MODULE=on CGO_ENABLED=1 # Install dependencies for cgo RUN apk add --no-cache gcc musl-dev