From fbcea1bf6cac64fa5fb80eb5e193d5c546bacde8 Mon Sep 17 00:00:00 2001 From: Zhiqiang Li Date: Tue, 4 Apr 2023 13:15:08 +0800 Subject: [PATCH] chore: update docker --- .github/workflows/docker.yml | 21 ++++++++++++++++++++- Dockerfile | 6 +++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bf073e0..e15af9a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -16,13 +16,32 @@ jobs: uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to the GPR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push uses: docker/build-push-action@v4 with: + platforms: linux/amd64 push: true - tags: stulzq/azure-openai-proxy:${{ github.event.inputs.tags }} \ No newline at end of file + pull: true + labels: | + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} + org.opencontainers.image.revision=${{ github.sha }} + org.opencontainers.image.licenses=Apache-2.0 + tags: | + ${{ github.repository }}:${{ github.event.inputs.tags }} + # https://docs.docker.com/build/cache/backends/gha/ + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index fa288c6..9f909dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM golang:1.19 AS building -COPY . /building -WORKDIR /building +COPY . /builder +WORKDIR /builder RUN make build @@ -10,6 +10,6 @@ FROM alpine:3 WORKDIR /app EXPOSE 8080 -COPY --from=building /building/bin . +COPY --from=builder /builder/bin . ENTRYPOINT ["/app/azure-openai-proxy"] \ No newline at end of file