chore: update docker

This commit is contained in:
Zhiqiang Li
2023-04-04 13:15:08 +08:00
parent 7b496c477a
commit fbcea1bf6c
2 changed files with 23 additions and 4 deletions

View File

@@ -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 }}
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

View File

@@ -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"]