-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
60 lines (50 loc) · 2.15 KB
/
Dockerfile
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
FROM ubuntu:latest as builder
# Testing: gosu
#RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories \
# && apk add --update --no-cache gnupg gosu gcompat libgcc
RUN apt update \
&& apt install -y --no-install-recommends \
ca-certificates \
wget \
gnupg \
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ARG VERSION=0.21.0
ARG ARCH=x86_64
ARG BITCOIN_CORE_SIGNATURE=01EA5486DE18A882D4C2684590C8019E36C2E964
# We will be verifying pkg signature from main website, we will fetch, verify, and extract to Docker image
RUN cd /tmp \
&& wget https://bitcoincore.org/bin/bitcoin-core-${VERSION}/SHA256SUMS.asc \
&& gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys ${BITCOIN_CORE_SIGNATURE} \
&& gpg --verify SHA256SUMS.asc \
&& grep bitcoin-${VERSION}-${ARCH}-linux-gnu.tar.gz SHA256SUMS.asc > SHA25SUM \
&& wget https://bitcoincore.org/bin/bitcoin-core-${VERSION}/bitcoin-${VERSION}-${ARCH}-linux-gnu.tar.gz \
&& sha256sum -c SHA25SUM \
&& tar -xzvf bitcoin-${VERSION}-${ARCH}-linux-gnu.tar.gz -C /opt \
&& ln -sv bitcoin-${VERSION} /opt/bitcoin \
&& /opt/bitcoin/bin/test_bitcoin --show_progress \
&& rm -v /opt/bitcoin/bin/test_bitcoin /opt/bitcoin/bin/bitcoin-qt
FROM ubuntu:latest
LABEL maintainer="Praveen Beniwal <[email protected]>"
ENTRYPOINT ["docker-entrypoint.sh"]
ENV HOME /bitcoin
EXPOSE 8332 8333
#18332 18333 18443 18444 38333 38332
VOLUME ["/bitcoin/.bitcoin"]
WORKDIR /bitcoin
ARG GROUP_ID=1000
ARG USER_ID=1000
RUN groupadd -g ${GROUP_ID} bitcoin \
&& useradd -u ${USER_ID} -g bitcoin -d /bitcoin bitcoin
COPY --from=builder /opt/ /opt/
RUN apt update \
&& apt install -y --no-install-recommends gosu \
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& ln -sv /opt/bitcoin/bin/* /usr/local/bin
COPY ./btc_oneshot /usr/local/bin/
COPY ./btc_init /usr/local/bin/
COPY ./docker-entrypoint.sh /usr/local/bin/
ENV PATH="/usr/local/bin/docker-entrypoint.sh:${PATH}"
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/btc_init
RUN chmod +x /usr/local/bin/btc_oneshot
CMD ["btc_oneshot"]