Change the order of commands to be able to cache more layers in case of multiple builds triggered in a row
parent
fb1dbb4276
commit
01362f34ee
10
Dockerfile
10
Dockerfile
|
@ -1,13 +1,12 @@
|
||||||
FROM golang:alpine
|
FROM golang:alpine
|
||||||
|
|
||||||
COPY . /go/src/github.com/filebrowser/filebrowser
|
RUN apk add --no-cache git curl && \
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/filebrowser/filebrowser
|
|
||||||
RUN apk --no-cache --update upgrade && apk --no-cache add ca-certificates git curl && \
|
|
||||||
curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 && \
|
curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 && \
|
||||||
chmod +x /usr/local/bin/dep
|
chmod +x /usr/local/bin/dep
|
||||||
RUN dep ensure -vendor-only
|
|
||||||
|
|
||||||
|
COPY . /go/src/github.com/filebrowser/filebrowser
|
||||||
|
WORKDIR /go/src/github.com/filebrowser/filebrowser
|
||||||
|
RUN dep ensure -vendor-only
|
||||||
WORKDIR /go/src/github.com/filebrowser/filebrowser/cmd/filebrowser
|
WORKDIR /go/src/github.com/filebrowser/filebrowser/cmd/filebrowser
|
||||||
RUN CGO_ENABLED=0 go build -a
|
RUN CGO_ENABLED=0 go build -a
|
||||||
RUN mv filebrowser /go/bin/filebrowser
|
RUN mv filebrowser /go/bin/filebrowser
|
||||||
|
@ -15,7 +14,6 @@ RUN mv filebrowser /go/bin/filebrowser
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=0 /go/bin/filebrowser /filebrowser
|
COPY --from=0 /go/bin/filebrowser /filebrowser
|
||||||
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||||
|
|
||||||
VOLUME /tmp
|
VOLUME /tmp
|
||||||
VOLUME /srv
|
VOLUME /srv
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
Loading…
Reference in New Issue