forked from monokal/docker-bootstrap-dht
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (23 loc) · 1.05 KB
/
Dockerfile
File metadata and controls
28 lines (23 loc) · 1.05 KB
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
FROM alpine:latest AS builder
ENV APK_DEPS alpine-sdk build-base git linux-headers tar wget
ENV BOOST_URL https://sourceforge.net/projects/boost/files/boost/1.82.0/boost_1_82_0.tar.gz
ENV BOOST_ROOT /tmp/boost
ENV DHT_REPO_URL https://github.com/bittorrent/bootstrap-dht.git
# Package dependencies installed to compile/execute the "bootstrap-dht" binary.
RUN apk add --no-cache $APK_DEPS &&\
mkdir $BOOST_ROOT && \
wget $BOOST_URL -O /tmp/boost.tar.gz && \
tar -zxvf /tmp/boost.tar.gz -C $BOOST_ROOT --strip-components 1 && \
cd $BOOST_ROOT && \
./bootstrap.sh && \
./bootstrap.sh --prefix=/usr && \
./b2 install --with-system && \
git clone $DHT_REPO_URL /tmp/bootstrap-dht &&\
sed -i 's_uuid/_uuid/detail/_g' /tmp/bootstrap-dht/src/main.cpp &&\
cd /tmp/bootstrap-dht/ &&\
${BOOST_ROOT}/b2 -sBOOST_ROOT=${BOOST_ROOT} toolset=gcc cxxflags="-std=c++11"
FROM alpine:latest
RUN apk add --no-cache boost-dev
COPY --from=builder /tmp/bootstrap-dht/dht-bootstrap /usr/local/bin/
EXPOSE 6881
ENTRYPOINT ["/usr/local/bin/dht-bootstrap"]