From f839241ffb322d42748a5c20155a5077fe23f54c Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Sat, 19 Sep 2020 11:48:34 -0700 Subject: [PATCH] Continuing to cleanup --- Dockerfile | 11 +++++++---- Makefile | 4 +--- README.md | 5 +++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8405115..7ae05e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,7 @@ RUN mkdir -p /app \ && chown -R nobody:nogroup /app WORKDIR /app +# Source: https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#ubuntu--debian RUN apt-get update && apt-get install -y make gcc g++ autoconf autotools-dev bsdmainutils build-essential git libboost-all-dev \ libcurl4-openssl-dev libdb++-dev libevent-dev libssl-dev libtool pkg-config python python-pip libzmq3-dev wget @@ -68,7 +69,9 @@ RUN cd src \ ## Build Final Image FROM ubuntu:18.04 -RUN apt-get update && apt-get install -y libevent-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev +RUN apt-get update && \ + apt-get install --no-install-recommends -y libevent-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev && \ + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN mkdir -p /app \ && chown -R nobody:nogroup /app \ @@ -77,10 +80,10 @@ RUN mkdir -p /app \ WORKDIR /app -# Copy binaries from build containers -COPY --from=bitcoind-builder /app/* /app/ +# Copy binary from bitcoind-builder +COPY --from=bitcoind-builder /app/bitcoind /app/bitcoind -# Copy configuration files and set permissions +# Copy binary from rosetta-builder COPY --from=rosetta-builder /app/* /app/ # Set permissions for everything added to /app diff --git a/Makefile b/Makefile index 533ba14..83fccac 100644 --- a/Makefile +++ b/Makefile @@ -26,10 +26,8 @@ build-local: docker build -t rosetta-bitcoin:latest . build-release: - # https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages docker build -t rosetta-bitcoin:$(version) .; - docker tag rosetta-bitcoin:$(version) docker.pkg.github.com/coinbase/rosetta-bitcoin/rosetta-bitcoin:$(version); - docker push docker.pkg.github.com/coinbase/rosetta-bitcoin/rosetta-bitcoin:$(version); + docker save rosetta-bitcoin:$(version) | gzip > rosetta-bitcoin-$(version).tar.gz; run-mainnet-online: docker run -d --ulimit "nofile=${NOFILE}:${NOFILE}" -v "${PWD}/bitcoin-data:/data" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -p 8080:8080 -p 8333:8333 rosetta-bitcoin:latest diff --git a/README.md b/README.md index df62232..88b1fed 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ all Rosetta implementations must be deployable via Docker and support running vi ### Install #### Pre-Built You can download a pre-built Docker image from GitHub: +TODO: Change to docker import from a release ```text docker pull docker.pkg.github.com/coinbase/rosetta-bitcoin/rosetta-bitcoin:v0.0.1 ``` @@ -52,7 +53,7 @@ and start the `rosetta-bitcoin` server at port `8080`. #### Mainnet:Online ```text -docker run -d --ulimit "nofile=100000:100000" -v "$(shell pwd)/bitcoin-data:/data" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -p 8080:8080 -p 8333:8333 rosetta-bitcoin:v0.0.1 +docker run -d --ulimit "nofile=100000:100000" -v "$(pwd)/bitcoin-data:/data" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -p 8080:8080 -p 8333:8333 rosetta-bitcoin:v0.0.1 ``` #### Mainnet:Offline @@ -62,7 +63,7 @@ docker run -d -e "MODE=OFFLINE" -e "NETWORK=MAINNET" -e "PORT=8081" -p 8081:8081 #### Testnet:Online ```text -docker run -d --ulimit "nofile=100000:100000" -v "$(shell pwd)/bitcoin-data:/data" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -p 8080:8080 -p 18333:18333 rosetta-bitcoin:v0.0.1 +docker run -d --ulimit "nofile=100000:100000" -v "$(pwd)/bitcoin-data:/data" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -p 8080:8080 -p 18333:18333 rosetta-bitcoin:v0.0.1 ``` #### Testnet:Offline