-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
84 lines (67 loc) · 2.45 KB
/
Dockerfile.dev
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# FROM alblockmed/go-node:latest as builder
FROM alblockmed/go11-node:latest
WORKDIR /root
RUN apk update && apk upgrade && \
apk add --no-cache bash git \
busybox-extras \
python \
python-dev \
py-pip \
libtool \
build-base \
make gcc musl-dev linux-headers \
&& rm -rf /var/cache/apk/* && \
echo "export PATH=/usr/local/go/bin:\$GOPATH/bin:\$PATH:\$HOME/bin" > /etc/profile.d/go_path.sh
# Install go-ipfs and gx
RUN source /etc/profile.d/go_path.sh && \
go get -u -d github.com/ipfs/go-ipfs && cd $GOPATH/src/github.com/ipfs/go-ipfs && \
make install_unsupported
# Install geth
RUN cd /root; \
git clone -b release/1.8 --depth 1 https://github.com/matr1xc0in/go-ethereum.git && \
cd /root/go-ethereum && make geth && cp /root/go-ethereum/build/bin/geth /usr/local/bin/geth
# FROM alblockmed/alpine-node:latest
LABEL maintainer="matr1xc0in"
ENV SHELL=/bin/bash \
IPFS_USER=ipfsuser \
IPFS_UID=3888 \
IPFS_GID=4888 \
GOPATH=/go
ENV HOME=/home/$IPFS_USER
USER root
WORKDIR /root
RUN apk update && apk upgrade && \
apk add --no-cache ca-certificates bash git busybox-extras && \
rm -rf /var/cache/apk/* && \
echo "export PATH=/usr/local/go/bin:\$GOPATH/bin:\$PATH:\$HOME/bin" > /etc/profile.d/go_path.sh
# COPY --from=builder /usr/local/go/bin/* /usr/local/go/bin/
# COPY --from=builder /go/bin/* /go/bin/
# COPY --from=builder /root/go-ethereum/build/bin/geth /usr/local/bin/
# Install go-ipfs and gx
RUN addgroup -g $IPFS_GID $IPFS_USER && \
adduser -u $IPFS_UID -g $IPFS_GID -h $HOME -S -s /bin/bash $IPFS_USER && \
chmod g+w /etc/passwd /etc/group && \
source /etc/profile.d/go_path.sh && \
chown -R $IPFS_UID:$IPFS_GID $HOME && \
chown -R $IPFS_UID:$IPFS_GID /usr/local/bin/geth && \
chown -R $IPFS_UID:$IPFS_GID /usr/local/go/bin/* && \
chown -R $IPFS_UID:$IPFS_GID /go/bin/* && \
mkdir -p $HOME/ipfs && chown -R $IPFS_UID:$IPFS_GID $HOME/ipfs ; \
echo "export IPFS_PATH=$HOME/ipfs" > /etc/profile.d/ipfs_path.sh
ENV IPFS_VERSION=0.4.15 \
IPFS_SHA256=48a81cfc34d3a12c8563dbdfae8681be6e4d23c0664d6a192bc2758c4e4ef377
USER $IPFS_UID
WORKDIR $HOME
# Install ipfs JS API
RUN mkdir $HOME/bin && \
npm install --save \
&& ln -s $HOME/node_modules/dat/bin/cli.js $HOME/bin/dat
EXPOSE 3000
# Geth ports
EXPOSE 8545 8546 30303 30303/udp