Skip to content

Commit ffd86e8

Browse files
committed
Update to Go 1.11
Closes: #27 Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent cf9bec9 commit ffd86e8

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM golang:1.10.4 as builder
1+
FROM golang:1.11 as builder
2+
ENV CGO_ENABLED=0
3+
24
RUN mkdir -p /go/src/github.com/openfaas-incubator/vcenter-connector
35
WORKDIR /go/src/github.com/openfaas-incubator/vcenter-connector
46

@@ -14,7 +16,7 @@ RUN go test -v ./...
1416
# Stripping via -ldflags "-s -w"
1517
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o ./connector
1618

17-
FROM alpine:3.8
19+
FROM alpine:3.10 as ship
1820

1921
RUN addgroup -S app \
2022
&& adduser -S -g app app

Dockerfile.armhf

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM golang:1.10.4 as builder
1+
FROM golang:1.11 as builder
2+
ENV CGO_ENABLED=0
3+
24
RUN mkdir -p /go/src/github.com/openfaas-incubator/vcenter-connector
35
WORKDIR /go/src/github.com/openfaas-incubator/vcenter-connector
46

@@ -12,12 +14,21 @@ RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*"))"
1214
RUN go test -v ./...
1315

1416
# Stripping via -ldflags "-s -w"
15-
RUN GOARM=7 CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o ./connector
17+
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o ./connector
18+
19+
FROM alpine:3.10 as ship
20+
21+
RUN addgroup -S app \
22+
&& adduser -S -g app app
1623

17-
FROM alpine:3.8
24+
WORKDIR /home/app
1825

1926
EXPOSE 8989
2027

21-
COPY --from=builder /go/src/github.com/openfaas-incubator/vcenter-connector/ .
28+
COPY --from=builder /go/src/github.com/openfaas-incubator/vcenter-connector/connector .
29+
30+
RUN chown -R app:app ./
31+
32+
USER app
2233

2334
CMD ["./connector"]

0 commit comments

Comments
 (0)