This commit is contained in:
DeAlexPesh 2018-06-26 11:37:14 +00:00 committed by GitHub
commit 2927054eda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,11 +1,19 @@
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
RUN apk add --no-cache git curl && \
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
RUN curl -fsSL "$(curl -s "${DPURL}" \
| grep -i 'browser_download_url.*linux-amd64"' \
| cut -d '"' -f 4)" -o /usr/local/bin/dep \
&& chmod +x /usr/local/bin/dep
RUN dep ensure -vendor-only
WORKDIR /go/src/github.com/filebrowser/filebrowser/cmd/filebrowser
@ -15,10 +23,11 @@ RUN mv filebrowser /go/bin/filebrowser
FROM scratch
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 /srv
EXPOSE 80
COPY Docker.json /config.json
ENTRYPOINT ["/filebrowser", "--config", "/config.json"]