2019-03-19 13:50:03 +03:00
# WEBUI
2019-10-14 18:18:04 +03:00
FROM node:12.11 as webui
2019-03-19 13:50:03 +03:00
ENV WEBUI_DIR /src/webui
RUN mkdir -p $WEBUI_DIR
COPY ./webui/ $WEBUI_DIR /
WORKDIR $WEBUI_DIR
2019-10-14 18:18:04 +03:00
RUN npm install
2019-03-19 13:50:03 +03:00
RUN npm run build
# BUILD
2019-09-04 12:16:03 +03:00
FROM golang:1.13-alpine as gobuild
2019-03-19 13:50:03 +03:00
RUN apk --update upgrade \
2019-04-01 17:48:08 +03:00
&& apk --no-cache --no-progress add git mercurial bash gcc musl-dev curl tar ca-certificates tzdata \
&& update-ca-certificates \
&& rm -rf /var/cache/apk/*
2019-03-19 13:50:03 +03:00
RUN mkdir -p /usr/local/bin \
&& curl -fsSL -o /usr/local/bin/go-bindata https://github.com/containous/go-bindata/releases/download/v1.0.0/go-bindata \
&& chmod +x /usr/local/bin/go-bindata
WORKDIR /go/src/github.com/containous/traefik
2019-08-11 13:20:53 +03:00
# Download go modules
COPY go.mod .
COPY go.sum .
RUN GO111MODULE = on GOPROXY = https://proxy.golang.org go mod download
2019-03-19 13:50:03 +03:00
COPY . /go/src/github.com/containous/traefik
2019-03-19 14:24:04 +03:00
RUN rm -rf /go/src/github.com/containous/traefik/static/
2019-03-19 13:50:03 +03:00
COPY --from= webui /src/static/ /go/src/github.com/containous/traefik/static/
2019-03-19 14:24:04 +03:00
RUN ./script/make.sh generate binary
2019-03-19 13:50:03 +03:00
## IMAGE
FROM scratch
2019-04-01 17:48:08 +03:00
COPY --from= gobuild /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from= gobuild /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
2019-03-19 13:50:03 +03:00
COPY --from= gobuild /go/src/github.com/containous/traefik/dist/traefik /
EXPOSE 80
VOLUME [ "/tmp" ]
ENTRYPOINT [ "/traefik" ]