From a983f73c593fb470c389eed5e0cc56c2974cb71a Mon Sep 17 00:00:00 2001 From: Finn Date: Sun, 18 Feb 2024 14:51:11 -0800 Subject: [PATCH] add Containerfile + CI build --- .forgejo/workflows/docker-build.yaml | 19 +++++++++++++++++++ Containerfile | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 .forgejo/workflows/docker-build.yaml create mode 100644 Containerfile diff --git a/.forgejo/workflows/docker-build.yaml b/.forgejo/workflows/docker-build.yaml new file mode 100644 index 0000000..d979642 --- /dev/null +++ b/.forgejo/workflows/docker-build.yaml @@ -0,0 +1,19 @@ +on: + push: + branches: + - 'main' +jobs: + build-container: + runs-on: docker + container: + image: library/docker:dind + steps: + - run: apk add --no-cache nodejs git + - name: login to container registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login --username "${GITHUB_ACTOR}" --password-stdin git.janky.solutions + - name: build container + uses: docker/build-push-action@v4 + with: + file: Containerfile + tags: git.janky.solutions/finn/s3-caching-proxy:latest + push: true diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..4f1f21b --- /dev/null +++ b/Containerfile @@ -0,0 +1,9 @@ +FROM library/golang:1.20 as build +ADD * /go/caching-proxy/ +WORKDIR /go/caching-proxy +ARG GOPROXY=direct +RUN CGO_ENABLED=0 go build . + +FROM gcr.io/distroless/base-debian11 +COPY --from=build /go/caching-proxy/caching-proxy /caching-proxy +ENTRYPOINT ["/caching-proxy"]