-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
35 lines (24 loc) · 896 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# bcrypt in a container
#
# echo -n mysecret | docker run --rm -i bitnami/bcrypt
#
FROM golang:1.11-stretch as build
RUN apt-get update && apt-get install -y --no-install-recommends \
git make upx \
&& rm -rf /var/lib/apt/lists/*
RUN wget -q -O dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 && \
echo '287b08291e14f1fae8ba44374b26a2b12eb941af3497ed0ca649253e21ba2f83 dep' | sha256sum -c - && \
mv dep /usr/bin/ && chmod +x /usr/bin/dep
RUN go get -u \
github.com/golang/lint/golint \
golang.org/x/tools/cmd/goimports \
github.com/golang/dep/cmd/dep \
&& rm -rf $GOPATH/src/* && rm -rf $GOPATH/pkg/*
WORKDIR /go/src/app
COPY . .
RUN rm -rf out
RUN make
RUN upx --ultra-brute out/bcrypt
FROM bitnami/minideb:stretch
COPY --from=build /go/src/app/out/bcrypt /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/bcrypt"]