From 51a79761a2b771d107fbd39a12ba0b39956db244 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 22 Dec 2023 22:19:16 +0100 Subject: [PATCH] add docker image --- .github/workflows/release.yml | 11 +++++++++++ Dockerfile | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 38c29b2..5384130 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,3 +23,14 @@ jobs: extra_files: AUTHORS LICENSE README.md doc/man/whawty-nginx-sso.8 md5sum: false sha256sum: true + docker: + name: Build and Publish Docker Image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: VaultVulp/gp-docker-action@1.6.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + image-name: app + image-platform: linux/arm64,linux/amd64,linux/i386 + extract-git-tag: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e50523a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM golang:1.21 as builder +ADD . /src +RUN cd /src && CGO_ENABLED=0 go build ./cmd/whawty-nginx-sso + +FROM scratch +COPY --from=builder /src/whawty-nginx-sso /whawty-nginx-sso +ENTRYPOINT [ "/whawty-nginx-sso" ] +CMD [ "--config", "/config/config.yml", "run" ]