Skip to content

Commit

Permalink
Updated RGB node docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Oct 10, 2020
1 parent d16375c commit 12dc60e
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 17 deletions.
47 changes: 31 additions & 16 deletions Dockerfile/rgb-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,55 @@
ARG BUILDER_DIR=/srv/rgb


FROM rustlang/rust:nightly-slim as builder

ARG SRC_DIR=/usr/local/src/rgb
ARG BUILDER_DIR
ARG VERSION=0.1.0-rc.1

RUN apt-get update \
&& apt-get -y install --no-install-recommends \
build-essential cmake git libpq-dev libssl-dev libzmq3-dev pkg-config

WORKDIR /srv/app

ENV RGBNODE_VERSION=v0.1.0-beta.4
WORKDIR "$SRC_DIR"

RUN git clone -n https://github.com/LNP-BP/rgb-node.git . \
&& git checkout ${RGBNODE_VERSION} \
&& cargo build --release
&& git checkout ${VERSION:+tags/v}${VERSION:-master}


FROM debian:buster-slim
RUN cargo build --release

ENV APP_DIR=/srv/app USER=rgbnode
RUN mkdir "${BUILDER_DIR}"

RUN adduser --home ${APP_DIR} --shell /bin/bash --disabled-login \
--gecos "${USER} user" ${USER}
RUN cargo install --path . --root "${BUILDER_DIR}"

COPY --from=builder --chown=${USER}:${USER} \
${APP_DIR} ${APP_DIR}

FROM debian:buster-slim

ARG BUILDER_DIR
ARG BIN_DIR=/usr/local/bin
ARG DATA_DIR=/var/lib/rgb
ARG USER=rgbd

RUN apt-get update \
&& apt-get -y install --no-install-recommends \
libssl1.1 tini \
libssl1.1 \
tini \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR ${APP_DIR}
RUN adduser --home "${DATA_DIR}" --shell /bin/bash --disabled-login \
--gecos "${USER} user" ${USER}

COPY --from=builder --chown=${USER}:${USER} \
"${BUILDER_DIR}/bin/" "${BIN_DIR}"

WORKDIR "${BIN_DIR}"
USER ${USER}

RUN mkdir data
VOLUME "$DATA_DIR"

VOLUME ["${APP_DIR}/data"]
ENTRYPOINT ["/usr/bin/tini", "-g", "--", "/usr/local/bin/rgbd", \
"--bin-dir", "/usr/local/bin", "--data-dir", "./data"]
"--bin-dir", "/usr/local/bin", "--data-dir", "/var/lib/rgb"]

CMD ["-vvvv"]
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ alias sightning-cli='docker exec lightningd-signet lightning-cli --lightning-dir
`docker build Dockerfile/electrs --build-arg VERSION=<version>`
- nightly build:
`docker build Dockerfile/electrs`
- **RGB Node**:
- latest:
`docker build Dockerfile/rgbd --build-arg`
- version tagged:
`docker build Dockerfile/rgbd --build-arg VERSION=<version>`
- nightly build:
`docker build Dockerfile/rgbd --build-arg VERSION=`

#### Bitcoin Core

Expand Down Expand Up @@ -116,7 +123,12 @@ You can use your existing bitcoin blockchain directory using the following steps
--opt o=bind \
--opt type=none \
--opt device=/var/lib/electrs \
electrs
electrs
docker volume create --driver local \
--opt o=bind \
--opt type=none \
--opt device=/private/var/lib/rgb \
rgb
```
where `/var/lib/bitcoin` etc must be replaced with your destination directories
2. Edit `docker-compose/.env` file paths
Expand Down
1 change: 1 addition & 0 deletions docker-compose/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ BITCOIN_VOLUME_EXTERNAL=true
ELECTRS_VOLUME_EXTERNAL=true
LIGHTNING_VOLUME_EXTERNAL=true
ELEMENTS_VOLUME_EXTERNAL=true
RGB_VOLUME_EXTERNAL=true
21 changes: 21 additions & 0 deletions docker-compose/signet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,34 @@ services:
networks:
- bitcoinrpc

rgbd-signet:
container_name: rgbd-signet
image: lnpbp/rgbd:0.1.0-rc1
restart: unless-stopped
depends_on:
- bitcoind-signet
- electrs-signet
environment:
FUNGIBLED_RPC_ENDPOINT: "lnp://{node_id}@0.0.0.0:13015"
command:
- "-vvvv"
# - "--network signet"
ports:
- 13015:13015
volumes:
- rgb:/var/lib/rgb
networks:
- bitcoinrpc

volumes:
bitcoin:
external: "${BITCOIN_VOLUME_EXTERNAL:-false}"
electrs:
external: "${ELECTRS_VOLUME_EXTERNAL:-false}"
lightning:
external: "${LIGHTNING_VOLUME_EXTERNAL:-false}"
rgb:
external: "${RGB_VOLUME_EXTERNAL:-false}"

networks:
bitcoinrpc:
Expand Down

0 comments on commit 12dc60e

Please sign in to comment.