Skip to content

Commit

Permalink
Update Docker to go1.13.1, alpine3.10, modules, trimpath, latest cons…
Browse files Browse the repository at this point in the history
…ul and vault
  • Loading branch information
magiconair committed Oct 11, 2019
1 parent 5dbe08b commit f7ddf31
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions Dockerfile
@@ -1,22 +1,21 @@
FROM golang:1.11.5-alpine AS build
FROM golang:1.13.1-alpine AS build

ARG consul_version=1.4.2
ARG consul_version=1.6.1
ADD https://releases.hashicorp.com/consul/${consul_version}/consul_${consul_version}_linux_amd64.zip /usr/local/bin
RUN cd /usr/local/bin && unzip consul_${consul_version}_linux_amd64.zip

ARG vault_version=1.0.3
ARG vault_version=1.2.3
ADD https://releases.hashicorp.com/vault/${vault_version}/vault_${vault_version}_linux_amd64.zip /usr/local/bin
RUN cd /usr/local/bin && unzip vault_${vault_version}_linux_amd64.zip

WORKDIR /go/src/github.com/fabiolb/fabio
WORKDIR /src
COPY . .
ENV GO111MODULE=on
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -mod=vendor -ldflags "-s -w" ./...
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -ldflags "-s -w"
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -mod=vendor -trimpath -ldflags "-s -w" ./...
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -trimpath -ldflags "-s -w"

FROM alpine:3.8
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
COPY --from=build /go/src/github.com/fabiolb/fabio/fabio /usr/bin
FROM alpine:3.10
RUN apk update && apk add --no-cache ca-certificates
COPY --from=build /src/fabio /usr/bin
ADD fabio.properties /etc/fabio/fabio.properties
EXPOSE 9998 9999
ENTRYPOINT ["/usr/bin/fabio"]
Expand Down

0 comments on commit f7ddf31

Please sign in to comment.