-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d16375c
commit 12dc60e
Showing
4 changed files
with
66 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters