mirror of
https://github.com/sablierapp/sablier.git
synced 2026-01-02 19:17:33 +01:00
build(docker): reduce image size by ~10%
Switching from alpine to scratch as base image.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
FROM golang:1.22 AS build
|
||||
|
||||
RUN mkdir -p /etc/sablier/themes
|
||||
WORKDIR /src
|
||||
RUN go env -w GOMODCACHE=/root/.cache/go-build
|
||||
|
||||
@@ -18,11 +19,9 @@ ARG TARGETARCH
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
make BUILDTIME=${BUILDTIME} VERSION=${VERSION} GIT_REVISION=${REVISION} ${TARGETOS}/${TARGETARCH}
|
||||
|
||||
FROM alpine:3.20.3
|
||||
|
||||
RUN mkdir -p /etc/sablier/themes
|
||||
EXPOSE 10000
|
||||
FROM scratch
|
||||
|
||||
COPY --from=build /etc/sablier/themes /etc/sablier/themes
|
||||
COPY --from=build /src/sablier* /bin/sablier
|
||||
COPY docker/sablier.yaml /etc/sablier/sablier.yaml
|
||||
|
||||
|
||||
2
Makefile
2
Makefile
@@ -39,7 +39,7 @@ test-plugin-caddy:
|
||||
|
||||
.PHONY: docker
|
||||
docker:
|
||||
docker build -t acouvreur/sablier:local .
|
||||
docker build --build-arg BUILDTIME=$(BUILDTIME) --build-arg VERSION=$(VERSION) --build-arg REVISION=$(GIT_REVISION) -t acouvreur/sablier:local .
|
||||
|
||||
caddy:
|
||||
docker build -t caddy:local plugins/caddy
|
||||
|
||||
Reference in New Issue
Block a user