forked from filecoin-project/venus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.faucet
59 lines (47 loc) · 1.87 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
53
54
55
56
57
58
59
FROM golang:1.12.1-stretch
MAINTAINER Filecoin Dev Team
RUN apt-get update && apt-get install -y ca-certificates file sudo clang jq
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
ENV GO111MODULE on
ENV FILECOIN_USE_PRECOMPILED_RUST_PROOFS true
ENV FILECOIN_USE_PRECOMPILED_BLS_SIGNATURES true
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
COPY --from=0 /lib/x86_64-linux-gnu/libutil.so.1 /lib/libutil.so.1
COPY --from=0 /lib/x86_64-linux-gnu/libdl-2.24.so /lib/libdl.so.2
COPY --from=0 /lib/x86_64-linux-gnu/librt.so.1 /lib/librt.so.1
COPY --from=0 /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/libgcc_s.so.1
EXPOSE 9797
# There's an fs-repo, and initializes one if there isn't.
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/faucet"]