Update Dockerfile

This commit is contained in:
DeAlexPesh 2018-06-26 11:16:45 +05:00 committed by GitHub
parent e3162e7170
commit 1488639444
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,11 +1,19 @@
FROM golang:alpine FROM golang:alpine
COPY . /go/src/github.com/filebrowser/filebrowser ARG FBURL=https://github.com/filebrowser/filebrowser
ARG DPURL=https://api.github.com/repos/golang/dep/releases/latest
RUN apk add --no-cache git curl
WORKDIR /go/src/github.com/filebrowser
RUN git clone ${FBURL}
# COPY . /go/src/github.com/filebrowser/filebrowser
WORKDIR /go/src/github.com/filebrowser/filebrowser WORKDIR /go/src/github.com/filebrowser/filebrowser
RUN apk add --no-cache git curl && \ RUN curl -fsSL "$(curl -s "${DPURL}" \
curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 && \ | grep -i 'browser_download_url.*linux-amd64"' \
chmod +x /usr/local/bin/dep | cut -d '"' -f 4)" -o /usr/local/bin/dep \
&& chmod +x /usr/local/bin/dep
RUN dep ensure -vendor-only RUN dep ensure -vendor-only
WORKDIR /go/src/github.com/filebrowser/filebrowser/cmd/filebrowser WORKDIR /go/src/github.com/filebrowser/filebrowser/cmd/filebrowser
@ -15,10 +23,11 @@ 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 /go/src/github.com/filebrowser/filebrowser/Docker.json /config.json
# COPY Docker.json /config.json
VOLUME /tmp VOLUME /tmp
VOLUME /srv VOLUME /srv
EXPOSE 80 EXPOSE 80
COPY Docker.json /config.json
ENTRYPOINT ["/filebrowser", "--config", "/config.json"] ENTRYPOINT ["/filebrowser", "--config", "/config.json"]