@cryptotaxi247 / kubo / commits / ee9b46891

feat(docker): build with openssl by default

Steven Allen committed Jan 15, 2020 at 17:02 UTC ee9b46891b6e14c36e69368df54e1e03b37b3b4b
1 file changed +11 -7
Dockerfile
+11 -7
@@ -1,6 +1,12 @@
1 FROM golang:1.13.6-buster
2 LABEL maintainer="Steven Allen <steven@stebalien.com>"
3
4 +# Install deps
5 +RUN apt-get update && apt-get install -y \
6 + libssl-dev \
7 + ca-certificates \
8 + fuse
9 +
10 ENV SRC_DIR /go-ipfs
11
12 # Download packages first so they can be cached.
@@ -14,7 +20,7 @@ COPY . $SRC_DIR
20 # Also: fix getting HEAD commit hash via git rev-parse.
21 RUN cd $SRC_DIR \
22 && mkdir .git/objects \
17 - && make build
23 + && make build GOFLAGS=-tags=openssl
24
25 # Get su-exec, a very minimal tool for dropping privileges,
26 # and tini, a very minimal init daemon for containers
@@ -30,12 +36,6 @@ RUN set -x \
36 && wget -q -O tini https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini \
37 && chmod +x tini
38
33 -# Get the TLS CA certificates, they're not provided by busybox.
34 -RUN apt-get update && apt-get install -y ca-certificates
35 -
36 -# Install FUSE
37 -RUN apt-get update && apt-get install -y fuse
38 -
39 # Now comes the actual target image, which aims to be as small as possible.
40 FROM busybox:1.31.0-glibc
41 LABEL maintainer="Steven Allen <stven@stebalien.com>"
@@ -55,6 +55,10 @@ RUN chmod 4755 /usr/local/bin/fusermount
55 # This shared lib (part of glibc) doesn't seem to be included with busybox.
56 COPY --from=0 /lib/x86_64-linux-gnu/libdl.so.2 /lib/libdl.so.2
57
58 +# Copy over SSL libraries.
59 +COPY --from=0 /usr/lib/x86_64-linux-gnu/libssl.so* /usr/lib/
60 +COPY --from=0 /usr/lib/x86_64-linux-gnu/libcrypto.so* /usr/lib/
61 +
62 # Swarm TCP; should be exposed to the public
63 EXPOSE 4001
64 # Daemon API; must not be exposed publicly but to client services under you control