diff options
author | terminaldweller <devi@terminaldweller.com> | 2024-05-13 23:33:15 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2024-05-13 23:33:15 +0000 |
commit | b14a628da0416538024eccd8a06afdcca8ed86e5 (patch) | |
tree | c7e18a74d035a5158d46f83d14b2e7f1e01e7932 | |
parent | added a distroless build, made sure milla works with gvisor's runsc as the ru... (diff) | |
download | milla-b14a628da0416538024eccd8a06afdcca8ed86e5.tar.gz milla-b14a628da0416538024eccd8a06afdcca8ed86e5.zip |
added a vendored build of milla with docker
-rw-r--r-- | Dockerfile_distroless_vendored | 10 | ||||
-rw-r--r-- | README.md | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/Dockerfile_distroless_vendored b/Dockerfile_distroless_vendored new file mode 100644 index 0000000..6c84307 --- /dev/null +++ b/Dockerfile_distroless_vendored @@ -0,0 +1,10 @@ +FROM golang:1.21 as builder +WORKDIR /milla +COPY go.sum go.mod /milla/ +COPY vendor /milla/vendor +COPY *.go /milla/ +RUN CGO_ENABLED=0 go build + +FROM gcr.io/distroless/static-debian12 +COPY --from=builder /milla/milla "/usr/bin/milla" +ENTRYPOINT ["milla"] @@ -219,7 +219,7 @@ services: max-size: "100m" networks: - millanet - user: 1000:1000 + user: ${UID}:${GID} restart: unless-stopped command: ["--config", "/opt/milla/config.toml"] volumes: @@ -236,7 +236,8 @@ networks: The env vars `UID`and `GID`need to be defined or they can replaces by your host user's uid and gid.<br/> -As a convinience, there is a a [distroless](https://github.com/GoogleContainerTools/distroless) dockerfile, `Dockerfile_distroless` also provided. +As a convinience, there is a a [distroless](https://github.com/GoogleContainerTools/distroless) dockerfile, `Dockerfile_distroless` also provided.<br/> +A vendored build of milla is available by first running `go mod vendor` and then using the provided Dockerfile, `Dockerfile_distroless_vendored`.<br/> ## Thanks |