add Containerfile + CI build

This commit is contained in:
Finn 2024-02-18 14:51:11 -08:00
parent 4cafcc1a11
commit a983f73c59
2 changed files with 28 additions and 0 deletions

View file

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

9
Containerfile Normal file
View file

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