Commit 5bef64dd authored by Geoff Simmons's avatar Geoff Simmons

Add Dockerfile.

parent 9c14c025
FROM golang:1.11.6 as builder
RUN /usr/sbin/adduser --system --no-create-home http-faccess
RUN go get -d -v github.com/slimhazard/gogitversion && \
cd /go/src/github.com/slimhazard/gogitversion && \
make install
WORKDIR $GOPATH/src/code.uplex.de/uplex-varnish/http-faccess
COPY go.mod .
COPY go.sum .
ENV GO111MODULE=on
RUN go mod download
COPY main.go .
COPY ./.git/ .
RUN go generate && \
GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags='-w -s' \
-o /go/bin/http-faccess
FROM scratch
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /go/bin/http-faccess /go/bin/http-faccess
USER http-faccess
ENTRYPOINT ["/go/bin/http-faccess"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment