1
0
Fork 0
he-dns-editor/Dockerfile

38 lines
743 B
Docker
Raw Permalink Normal View History

2019-02-16 20:35:47 +08:00
FROM golang:1.11-alpine as build
# args
ARG version="0.1"
ARG repo="git.makerforce.io/cacti/he-dns-editor"
# dependencies
2019-02-16 20:40:56 +08:00
RUN apk add --no-cache ca-certificates git
2019-02-16 20:35:47 +08:00
# source
WORKDIR $GOPATH/src/${repo}
COPY . .
# build
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
2019-02-16 20:38:09 +08:00
RUN go get
2019-02-16 20:35:47 +08:00
RUN go build -ldflags "-s -w" -o /he-dns-editor
FROM scratch
ARG version
# labels
LABEL org.label-schema.vcs-url="https://git.makerforce.io/cacti/he-dns-editor"
LABEL org.label-schema.version=${version}
LABEL org.label-schema.schema-version="1.0"
# copy binary and ca certs
2019-02-16 20:52:25 +08:00
COPY --from=build /he-dns-editor /he-dns-editor
2019-02-16 20:35:47 +08:00
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
EXPOSE 8080
ENTRYPOINT ["/he-dns-editor"]