dockerfile: update to latest images, and update the 2nd stage image on build
This commit is contained in:
parent
4391192a15
commit
2109ac9455
11
Dockerfile
11
Dockerfile
|
@ -1,15 +1,16 @@
|
||||||
FROM golang:1.10-alpine3.7 as builder
|
FROM golang:1.12-alpine3.10 as builder
|
||||||
|
|
||||||
WORKDIR /go/src/vsphere-influxdb-go
|
WORKDIR /go/src/vsphere-influxdb-go
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN apk --update add --virtual build-deps git
|
RUN apk --update add --virtual build-deps git
|
||||||
RUN go get -d -v ./...
|
RUN go get -d -v ./...
|
||||||
#RUN go install -v ./...
|
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:3.10
|
||||||
RUN apk --update add ca-certificates \
|
RUN apk update \
|
||||||
&& addgroup -S spock && adduser -S spock -G spock
|
&& apk upgrade \
|
||||||
|
&& apk add ca-certificates \
|
||||||
|
&& addgroup -S spock && adduser -S spock -G spock
|
||||||
COPY --from=0 /go/src/vsphere-influxdb-go/vsphere-influxdb-go /vsphere-influxdb-go
|
COPY --from=0 /go/src/vsphere-influxdb-go/vsphere-influxdb-go /vsphere-influxdb-go
|
||||||
|
|
||||||
USER spock
|
USER spock
|
||||||
|
|
Loading…
Reference in New Issue