commit 1bdf7b46c6ed3cc78a8583409fbe12dd28748fd4 Author: Dominic Grimm Date: Tue Apr 11 13:13:04 2023 +0200 Init diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..63655ae --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +Dockerfile +.dockerignore +Makefile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..400263a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM docker.io/alpine/git:2.36.3 as puller +WORKDIR /usr/src/gbox +ARG GBOX_VERSION +RUN git clone --depth 1 --branch v${GBOX_VERSION} https://github.com/gbox-proxy/gbox.git . + +FROM docker.io/golang:1.17.13-alpine3.16 as builder +WORKDIR /usr/src/gbox +COPY --from=puller /usr/src/gbox . +RUN go build ./cmd/main.go + +FROM docker.io/caddy:2.6.4-alpine +LABEL maintainer="Dominic Grimm " \ + org.opencontainers.image.description="Custom build of the GBox Proxy" \ + org.opencontainers.image.licenses="Apache License 2.0" \ + org.opencontainers.image.source="https://git.dergrimm.net/dergrimm/gbox" \ + org.opencontainers.image.url="https://git.dergrimm.net/dergrimm/gbox" +COPY --from=builder /usr/src/gbox/Caddyfile.dist /etc/caddy/Caddyfile +COPY --from=builder /usr/src/gbox/main /usr/bin/caddy diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..62811ab --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +.PHONY: build + +GBOX_VERSION = 1.0.6 + +build: + docker build . -t git.dergrimm.net/dergrimm/gbox:$(GBOX_VERSION) --build-arg GBOX_VERSION=$(GBOX_VERSION)