mirror of
https://git.mills.io/kayos/bitraft.git
synced 2024-06-29 18:21:39 +00:00
![dependabot[bot]](/assets/img/avatar_default.png)
Bumps golang from 1.16.4 to 1.16.5. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
37 lines
779 B
Docker
37 lines
779 B
Docker
ARG BASE=alpine:latest
|
|
ARG GOOS=linux
|
|
ARG GOARCH=amd64
|
|
|
|
# Build the purge binary
|
|
FROM golang:1.16.5 as builder
|
|
|
|
WORKDIR /workspace
|
|
# Copy the Go Modules manifests
|
|
COPY go.mod go.mod
|
|
COPY go.sum go.sum
|
|
# cache deps before building and copying source so that we don't need to re-download as much
|
|
# and so that source changes don't invalidate our downloaded layer
|
|
RUN go mod download
|
|
|
|
# Copy the go source
|
|
COPY main.go version.go server.go ./
|
|
|
|
# Build
|
|
RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GO111MODULE=on go build -a -o bitraft
|
|
|
|
RUN mkdir data
|
|
|
|
FROM $BASE
|
|
WORKDIR /app
|
|
COPY --from=builder /workspace/bitraft .
|
|
COPY --from=builder --chown=65532:65532 /workspace/data /data
|
|
|
|
EXPOSE 4920/tcp
|
|
|
|
USER 65532:65532
|
|
|
|
VOLUME /data
|
|
|
|
ENTRYPOINT ["/app/bitraft"]
|
|
CMD ["-d", "/data"]
|