Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,10 @@ RUN apk add -U --no-cache git && \

FROM golang:alpine

WORKDIR /go/src/github.com/filebrowser/filebrowser

COPY --from=base /go/bin /go/bin
COPY get_deps.sh ./get_deps.sh

ENV CGO_ENABLED 0

RUN 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 /go/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 /go/bin/dep && \
curl -sL https://git.io/goreleaser -o /go/bin/goreleaser && \
chmod +x /go/bin/goreleaser && \
curl -fsSL https://download.docker.com/linux/static/edge/x86_64/docker-18.05.0-ce.tgz | tar xvz --strip-components=1 docker/docker -C /go/bin && \
chmod +x /go/bin/docker && \
curl -fsSL $( \
curl -s https://api.github.com/repos/docker/docker-credential-helpers/releases/latest \
| grep "browser_download_url.*pass-.*-amd64" \
| cut -d : -f 2,3 \
| tr -d \" \
) | tar xv -C /go/bin && \
chmod + /go/bin/docker-credential-pass
chmod +x get_deps.sh && ./get_deps.sh && rm get_deps.sh
32 changes: 32 additions & 0 deletions get_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

#-- go.rice

go get github.com/GeertJohan/go.rice/rice

#-- goreleaser

curl -sL https://git.io/goreleaser -o /go/bin/goreleaser

chmod +x /go/bin/goreleaser

#-- docker

curl -fsSL https://download.docker.com/linux/static/edge/x86_64/docker-18.05.0-ce.tgz | tar xvz --strip-components=1 docker/docker -C /go/bin

chmod +x /go/bin/docker

#-- docker-credential-pass

PASS_URL="$(curl -s https://api.github.com/repos/docker/docker-credential-helpers/releases/latest \
| grep "browser_download_url.*pass-.*-amd64" \
| cut -d : -f 2,3 \
| tr -d \")"

if [ "$(echo "$PASS_URL" | cut -c2-6)" != "https" ]; then
PASS_URL="https://github.com/docker/docker-credential-helpers/releases/download/v0.6.0/docker-credential-pass-v0.6.0-amd64.tar.gz"
fi

curl -fsSL "$PASS_URL" | tar xv -C /go/bin

chmod + /go/bin/docker-credential-pass