diff --git a/docker/README.md b/docker/README.md index f237438..27662d3 100644 --- a/docker/README.md +++ b/docker/README.md @@ -65,5 +65,9 @@ docker compose --env-file bs-linux.env --file bs-linux.yml up -t 3600 -d ##### Terminating container ``` -docker compose --env-file bs-linux.env --file bs-linux.yml down -t 3600 -v +docker compose --env-file bs-linux.env --file bs-linux.yml down -t 3600 ``` + +Note that `-v` would remove listed volumes. +In the case of `bs`, this includes blockchain storage. + diff --git a/docker/bs-linux.Dockerfile b/docker/bs-linux.Dockerfile index fdd1245..51ca65f 100644 --- a/docker/bs-linux.Dockerfile +++ b/docker/bs-linux.Dockerfile @@ -1,7 +1,7 @@ FROM alpine:latest AS build ENV OPTIMIZATION="-O3" -ENV BUILD_DEPS="build-base linux-headers gcc make autoconf automake libtool pkgconf git wget bash" +ENV BUILD_DEPS="build-base linux-headers g++ make autoconf automake libtool pkgconf git wget bash" ENV CFLAGS="${OPTIMIZATION}" ENV CXXFLAGS="${OPTIMIZATION}" @@ -14,7 +14,9 @@ RUN mkdir -p /build/src /build/obj /build/prefix COPY developer_setup.sh /build COPY src/ /build/src -RUN /build/developer_setup.sh \ +WORKDIR /build + +RUN ./developer_setup.sh \ --build-target=dependencies \ --build-src-dir=/build/src \ --build-obj-dir=/build/obj \ @@ -22,14 +24,14 @@ RUN /build/developer_setup.sh \ --build-mode=configure \ --disable-shared \ --enable-static \ - --enable-isystem \ - --without-consensus \ --with-icu \ --build-icu \ --build-boost \ --build-zmq -RUN /build/developer_setup.sh \ +ENV BOOST_ROOT="/build/prefix" + +RUN ./developer_setup.sh \ --build-target=libbitcoin \ --build-src-dir=/build/src \ --build-obj-dir=/build/obj \ @@ -40,11 +42,9 @@ RUN /build/developer_setup.sh \ --enable-isystem \ --without-consensus \ --with-icu \ - --build-icu \ - --build-boost \ - --build-zmq + --with-boost=/build/prefix -RUN /build/developer_setup.sh \ +RUN ./developer_setup.sh \ --build-target=project \ --build-src-dir=/build/src \ --build-obj-dir=/build/obj \ @@ -55,9 +55,7 @@ RUN /build/developer_setup.sh \ --enable-isystem \ --without-consensus \ --with-icu \ - --build-icu \ - --build-boost \ - --build-zmq + --with-boost=/build/prefix RUN rm -rf /build/src /build/obj @@ -65,7 +63,7 @@ RUN rm -rf /build/src /build/obj FROM alpine:latest AS runtime -ENV RUNTIME_DEPS="bash gcc" +ENV RUNTIME_DEPS="bash libstdc++" RUN apk update && \ apk add --update ${RUNTIME_DEPS} diff --git a/docker/bs-linux.yml b/docker/bs-linux.yml index b1ab8aa..8b25e28 100644 --- a/docker/bs-linux.yml +++ b/docker/bs-linux.yml @@ -1,3 +1,7 @@ +volumes: + blockchain: + name: "bitcoin-blockchain" + networks: net: @@ -19,7 +23,7 @@ services: - 9093:9093/tcp - 9094:9094/tcp volumes: - - ${STORAGE_BITCOIN_DATA}:/bitcoin/blockchain + - blockchain:/bitcoin/blockchain - ${STORAGE_BITCOIN_CONF}:/bitcoin/conf networks: - net diff --git a/docker/bx-linux.Dockerfile b/docker/bx-linux.Dockerfile index 7e639f1..8788af0 100644 --- a/docker/bx-linux.Dockerfile +++ b/docker/bx-linux.Dockerfile @@ -1,7 +1,7 @@ FROM alpine:latest AS build ENV OPTIMIZATION="-O3" -ENV BUILD_DEPS="build-base linux-headers gcc make autoconf automake libtool pkgconf git wget bash" +ENV BUILD_DEPS="build-base linux-headers g++ make autoconf automake libtool pkgconf git wget bash" ENV CFLAGS="${OPTIMIZATION}" ENV CXXFLAGS="${OPTIMIZATION}" @@ -14,7 +14,9 @@ RUN mkdir -p /build/src /build/obj /build/prefix COPY developer_setup.sh /build COPY src/ /build/src -RUN /build/developer_setup.sh \ +WORKDIR /build + +RUN ./developer_setup.sh \ --build-target=dependencies \ --build-src-dir=/build/src \ --build-obj-dir=/build/obj \ @@ -22,13 +24,14 @@ RUN /build/developer_setup.sh \ --build-mode=configure \ --disable-shared \ --enable-static \ - --enable-isystem \ --with-icu \ --build-icu \ --build-boost \ --build-zmq -RUN /build/developer_setup.sh \ +ENV BOOST_ROOT="/build/prefix" + +RUN ./developer_setup.sh \ --build-target=libbitcoin \ --build-src-dir=/build/src \ --build-obj-dir=/build/obj \ @@ -38,11 +41,9 @@ RUN /build/developer_setup.sh \ --enable-static \ --enable-isystem \ --with-icu \ - --build-icu \ - --build-boost \ - --build-zmq + --with-boost=/build/prefix -RUN /build/developer_setup.sh \ +RUN ./developer_setup.sh \ --build-target=project \ --build-src-dir=/build/src \ --build-obj-dir=/build/obj \ @@ -52,9 +53,7 @@ RUN /build/developer_setup.sh \ --enable-static \ --enable-isystem \ --with-icu \ - --build-icu \ - --build-boost \ - --build-zmq \ + --with-boost=/build/prefix \ --without-tests RUN rm -rf /build/src /build/obj @@ -63,12 +62,11 @@ RUN rm -rf /build/src /build/obj FROM alpine:latest AS runtime -ENV RUNTIME_DEPS="gcc" +ENV RUNTIME_DEPS="libstdc++" RUN apk update && \ apk add --update ${RUNTIME_DEPS} COPY --from=build /build/prefix/bin/bx /bitcoin/bx -WORKDIR /bitcoin ENTRYPOINT [ "/bitcoin/bx" ] diff --git a/generate4.xml b/generate4.xml index fb19ff2..a4f7668 100644 --- a/generate4.xml +++ b/generate4.xml @@ -291,7 +291,7 @@