Skip to content

Commit

Permalink
Update to Go 1.11
Browse files Browse the repository at this point in the history
Closes: #27

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Aug 22, 2019
1 parent cf9bec9 commit ffd86e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM golang:1.10.4 as builder
FROM golang:1.11 as builder
ENV CGO_ENABLED=0

RUN mkdir -p /go/src/github.com/openfaas-incubator/vcenter-connector
WORKDIR /go/src/github.com/openfaas-incubator/vcenter-connector

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

FROM alpine:3.8
FROM alpine:3.10 as ship

RUN addgroup -S app \
&& adduser -S -g app app
Expand Down
19 changes: 15 additions & 4 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM golang:1.10.4 as builder
FROM golang:1.11 as builder
ENV CGO_ENABLED=0

RUN mkdir -p /go/src/github.com/openfaas-incubator/vcenter-connector
WORKDIR /go/src/github.com/openfaas-incubator/vcenter-connector

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

# Stripping via -ldflags "-s -w"
RUN GOARM=7 CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o ./connector
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o ./connector

FROM alpine:3.10 as ship

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

FROM alpine:3.8
WORKDIR /home/app

EXPOSE 8989

COPY --from=builder /go/src/github.com/openfaas-incubator/vcenter-connector/ .
COPY --from=builder /go/src/github.com/openfaas-incubator/vcenter-connector/connector .

RUN chown -R app:app ./

USER app

CMD ["./connector"]

0 comments on commit ffd86e8

Please sign in to comment.