forked from filecoin-project/venus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.faucet
52 lines (40 loc) · 1.5 KB
/
Dockerfile.faucet
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM golang:1.11.2-stretch
MAINTAINER Filecoin Dev Team
RUN apt-get update && apt-get install -y ca-certificates file sudo clang
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y
# This docker file is a modified version of
# https://github.com/ipfs/go-ipfs/blob/master/Dockerfile
# Thanks Lars :)
ENV SRC_DIR /go/src/github.com/filecoin-project/go-filecoin
COPY . $SRC_DIR
# Build faucet
RUN cd $SRC_DIR \
&& . $HOME/.cargo/env \
&& go run ./build/*go deps \
&& go build -o ./faucet ./tools/faucet/main.go
RUN cd
# Get su-exec, a very minimal tool for dropping privileges,
# and tini, a very minimal init daemon for containers
ENV SUEXEC_VERSION v0.2
ENV TINI_VERSION v0.16.1
RUN set -x \
&& cd /tmp \
&& git clone https://github.com/ncopa/su-exec.git \
&& cd su-exec \
&& git checkout -q $SUEXEC_VERSION \
&& make \
&& cd /tmp \
&& wget -q -O tini https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini \
&& chmod +x tini
# Now comes the actual target image, which aims to be as small as possible.
FROM busybox:1-glibc
MAINTAINER Filecoin Dev Team
# Get the binary, entrypoint script, and TLS CAs from the build container.
ENV SRC_DIR /go/src/github.com/filecoin-project/go-filecoin
COPY --from=0 $SRC_DIR/faucet /usr/local/bin/faucet
COPY --from=0 /tmp/su-exec/su-exec /sbin/su-exec
COPY --from=0 /tmp/tini /sbin/tini
COPY --from=0 /etc/ssl/certs /etc/ssl/certs
EXPOSE 9797
# There's an fs-repo, and initializes one if there isn't.
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/faucet"]