From 17e85692b203e1b543b294572e6fa8104c9d3ef0 Mon Sep 17 00:00:00 2001 From: Leopere Date: Tue, 16 Oct 2018 20:50:45 -0400 Subject: [PATCH] Baseline Dockerfile template for compiler --- lbrycrd/compile/Dockerfile | 66 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/lbrycrd/compile/Dockerfile b/lbrycrd/compile/Dockerfile index e69de29..4e36290 100644 --- a/lbrycrd/compile/Dockerfile +++ b/lbrycrd/compile/Dockerfile @@ -0,0 +1,66 @@ +########################### +## Compiler/Builder Step ## +########################### +FROM ubuntu:18.04 as builder +LABEL MAINTAINER="@Brannon Update Me Or Put Mine Here" + +## Added apt work as single container layer then remove cruft before layer is committed. +RUN apt-get update && \ + apt-get install -y build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 git wget apt-utils && \ + apt-get install -y libssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libboost-locale-dev libboost-program-options-dev && \ + apt-get install -y python-dev libbz2-dev autoconf ca-certificates clang-format && \ + apt-get install -y software-properties-common && add-apt-repository -y ppa:bitcoin/bitcoin && apt-get update && apt-get install -y libdb4.8-dev libdb4.8++-dev && \ + apt-get -y install unzip wget && \ ## Cleanup Post apt package installation. + apt-get autoclean -y && \ + rm -rf /var/lib/apt/lists/* ## Others neednt play here(remove apt lists as no longer needed at this stage). + +## Add debugpaste here for reporting compiler errors. Psuedo code. +## RUN wget -O /usr/local/bin/debugpaste https://url && \ +## sha256sum check of debugpaste + +######################## +## Compile Steps Here ## +######################## +## Compile and Test steps should likely be separate run commands/layers. +RUN ## Compile/Test steps here + + +#################### +## App build step ## +#################### +FROM ubuntu:18.04 as app + +## Change this to pull from a certifiable source with supply chain in plain sight. +# RUN wget -O /usr/bin/debugpaste https://github.com/nixc-us/debugpaste-it/raw/master/bin/debugpaste_64 && \ +# chmod +x /usr/bin/debugpaste + +RUN adduser lbrycrd --gecos GECOS --shell /bin/bash --disabled-password --home /app + +# ## This section can be replaced with a COPY to pull artifacts from build step. +# # RUN wget -O /usr/bin/lbrycrd-linux.zip https://github.com/lbryio/lbrycrd/releases/download/v0.12.2.2/lbrycrd-linux.zip && \ +# # cd /usr/bin/ && \ +# # unzip lbrycrd-linux.zip && \ +# # rm lbrycrd-linux.zip && \ +# # chmod +x lbrycrdd lbrycrd-cli lbrycrd-tx +# COPY --chown=1000:1000 /path/to/compiled/lbrycrd/bins /app/ + +## This needn't be included until debugpaste is ready. +# COPY debugpaste-it.sh /usr/local/bin/debugpaste-it +# COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint +COPY start.sh /usr/local/bin/start + + +USER lbrycrdd + +RUN mkdir -p /data/ + +VOLUME /data/ +VOLUME /etc/lbrycrdd/ + +## Exposing daemon port and RPC port +EXPOSE 9245 9246 + +# ## For now this is a placeholder that executes /bin/bash on `docker exec` +# ENTRYPOINT ["docker-entrypoint"] + +CMD ["start"]