-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.debian
54 lines (42 loc) · 1.6 KB
/
Dockerfile.debian
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
FROM golang:1.13.4-buster
MAINTAINER George Masgras <[email protected]>
ENV SRC_DIR /go-dumpotron
# Download packages first so they can be cached.
COPY go.mod go.sum $SRC_DIR/
RUN cd $SRC_DIR \
&& go mod download
COPY . $SRC_DIR
# Build the thing.
# Also: fix getting HEAD commit hash via git rev-parse.
RUN cd $SRC_DIR \
&& go build
# Now comes the actual target image, which aims to be as small as possible.
FROM golang:1.13.4-buster
#MAINTAINER George Masgras <[email protected]>
# Get the TLS CA certificates, they're not provided by busybox.
RUN apt-get update && apt-get install -y ca-certificates graphviz
# Get su-exec, a very minimal tool for dropping privileges,
# and tini, a very minimal init daemon for containers
ENV SUEXEC_VERSION v0.2
RUN set -x \
&& cd /tmp \
&& git clone https://github.com/ncopa/su-exec.git \
&& cd su-exec \
&& git checkout -q $SUEXEC_VERSION \
&& make \
&& cp /tmp/su-exec/su-exec /sbin/su-exec
# Install ipfs-cluster-ctl
RUN set -x \
&& cd /tmp \
&& curl -O https://dist.ipfs.io/ipfs-cluster-ctl/v0.12.1/ipfs-cluster-ctl_v0.12.1_linux-amd64.tar.gz \
&& tar zxf ipfs-cluster-ctl*.tar.gz \
&& cp /tmp/ipfs-cluster-ctl/ipfs-cluster-ctl /usr/local/bin/ipfs-cluster-ctl
## Get the binary from the build container.
ENV SRC_DIR /go-dumpotron
COPY --from=0 $SRC_DIR/go-dumpotron /usr/local/bin/go-dumpotron
# add user
RUN useradd --system --no-create-home --no-user-group --uid 1000 dumpotron \
&& chown dumpotron:users /usr/local/bin/go-dumpotron
# webhook TCP should be exposed to the public
EXPOSE 9096
CMD ["su-exec", "dumpotron", "go-dumpotron"]