mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
add filebrowser/filebrowser:dev, move dep execution to build.sh
Former-commit-id: 691201333f6c76d5fe8d7134a1d68c4cc50404a7 [formerly a9973160b528bfe6b26bac2a6e1236e6e9192f0c] [formerly 84f8fdb79bd0929ef84a969a688ef1381e6ac691 [formerly d11aa8de6b
]]
Former-commit-id: 5d10ebcf1f43a9854aa8b66b1227220e81e34473 [formerly a6e486b7c3a40fa821c2250bcd9edc1841775887]
Former-commit-id: 7367476016ce2499441cdb2d050fb2f961eed4d0
This commit is contained in:
parent
56e5005484
commit
32f7efbde5
@ -1,20 +1,13 @@
|
||||
FROM golang:alpine
|
||||
|
||||
COPY . /go/src/github.com/filebrowser/filebrowser
|
||||
|
||||
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 && \
|
||||
chmod +x /usr/local/bin/dep
|
||||
RUN dep ensure -vendor-only
|
||||
|
||||
WORKDIR /go/src/github.com/filebrowser/filebrowser/cmd/filebrowser
|
||||
RUN CGO_ENABLED=0 go build -a
|
||||
RUN mv filebrowser /go/bin/filebrowser
|
||||
|
||||
FROM scratch
|
||||
COPY --from=0 /go/bin/filebrowser /filebrowser
|
||||
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY --from=filebrowser/dev /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
VOLUME /tmp
|
||||
VOLUME /srv
|
||||
|
13
Dockerfile.dev
Normal file
13
Dockerfile.dev
Normal file
@ -0,0 +1,13 @@
|
||||
FROM golang:alpine
|
||||
|
||||
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
|
||||
sed -i -e "s/v[0-9]\.[0-9]/edge/g" /etc/apk/repositories && \
|
||||
apk --no-cache -U upgrade && apk --no-cache add ca-certificates yarn git curl dos2unix && \
|
||||
go get github.com/GeertJohan/go.rice/rice && \
|
||||
curl -fsSL -o /usr/local/bin/dep $( \
|
||||
curl -s https://api.github.com/repos/golang/dep/releases/latest \
|
||||
| grep "browser_download_url.*linux-amd64\"" \
|
||||
| cut -d : -f 2,3 \
|
||||
| tr -d \" \
|
||||
) && \
|
||||
chmod +x /usr/local/bin/dep
|
3
build.sh
3
build.sh
@ -1,4 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cd $(dirname $0)
|
||||
@ -16,6 +17,8 @@ yarn build
|
||||
|
||||
cd ..
|
||||
|
||||
dep ensure -vendor-only
|
||||
|
||||
# Install rice tool if not present
|
||||
if ! [ -x "$(command -v rice)" ]; then
|
||||
go get github.com/GeertJohan/go.rice/rice
|
||||
|
@ -1,17 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cd $(dirname $0)
|
||||
|
||||
docker pull golang:alpine
|
||||
WORKDIR="/go/src/github.com/filebrowser/filebrowser"
|
||||
|
||||
$(command -v winpty) docker run --rm -it \
|
||||
-v /$(pwd)://src \
|
||||
-w //src \
|
||||
golang:alpine \
|
||||
-v /$(pwd):/${WORKDIR} \
|
||||
-w /${WORKDIR} \
|
||||
filebrowser/filebrowser:dev \
|
||||
sh -c '\
|
||||
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
|
||||
sed -i -e "s/v[0-9]\.[0-9]/edge/g" /etc/apk/repositories && \
|
||||
apk add -U --no-cache yarn git && \
|
||||
go get github.com/GeertJohan/go.rice/rice && \
|
||||
dos2unix build.sh && \
|
||||
./build.sh \
|
||||
'
|
||||
|
Loading…
Reference in New Issue
Block a user