From 5f5c2c73bfeb947fb5271f6a0b38a1581fca9545 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Wed, 28 Oct 2020 09:35:08 -0500 Subject: [PATCH 1/3] update dockerfile to install required deps and expose required ports, include make command --- Dockerfile | 17 ++++++++++++++--- Makefile | 3 +++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5a31d4ab308b..6cef97afa75d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # docker build -t forest:latest -f ./Dockerfile . # docker run forest -FROM rust:1.42-stretch AS build-env +FROM rust:1.47-buster AS build-env WORKDIR /usr/src/forest COPY . . @@ -17,8 +17,8 @@ RUN rm -f $PROTOC_ZIP # Extra dependencies needed for rust-fil-proofs RUN apt-get update && \ - apt-get install -y curl file gcc g++ git make openssh-client \ - autoconf automake cmake libtool libcurl4-openssl-dev libssl-dev \ + apt-get install --no-install-recommends -y curl file gcc g++ hwloc libhwloc-dev git make openssh-client \ + ca-certificates autoconf automake cmake libtool libcurl4 libcurl4-openssl-dev libssl-dev \ libelf-dev libdw-dev binutils-dev zlib1g-dev libiberty-dev wget \ xz-utils pkg-config python clang ocl-icd-opencl-dev @@ -27,7 +27,18 @@ RUN cargo install --path forest # Prod image for forest binary FROM debian:buster-slim +# Install binary dependencies +RUN apt-get update && \ + apt-get install --no-install-recommends -y curl file gcc g++ hwloc libhwloc-dev make openssh-client \ + autoconf automake cmake libtool libcurl4 libcurl4-openssl-dev libssl-dev \ + libelf-dev libdw-dev binutils-dev zlib1g-dev libiberty-dev wget \ + xz-utils pkg-config python clang ocl-icd-opencl-dev ca-certificates + # Copy over binaries from the build-env COPY --from=build-env /usr/local/cargo/bin/forest /usr/local/bin/forest +# Expose ports for RPC +EXPOSE 1234 +EXPOSE 64899 + CMD ["forest"] diff --git a/Makefile b/Makefile index b99f40659f0c..7931a0b72c0d 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,9 @@ build: release: cargo build --release --bin forest +docker-run: + docker build -t forest:latest -f ./Dockerfile . && docker run forest + # Git submodule test vectors pull-serialization-tests: git submodule update --init From eecad7de0f1ba3f5329b06bd12b79f442dc4129a Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Wed, 28 Oct 2020 10:28:24 -0500 Subject: [PATCH 2/3] Removed unneeded port exposure --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6cef97afa75d..b4b3a1d2ae1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,6 +39,5 @@ COPY --from=build-env /usr/local/cargo/bin/forest /usr/local/bin/forest # Expose ports for RPC EXPOSE 1234 -EXPOSE 64899 CMD ["forest"] From b2b8fd5dbf0479e985c7b9a1d093db0c84c7053c Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Wed, 28 Oct 2020 11:32:10 -0500 Subject: [PATCH 3/3] remove both ports --- Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b4b3a1d2ae1c..849070d2fe5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,4 @@ RUN apt-get update && \ # Copy over binaries from the build-env COPY --from=build-env /usr/local/cargo/bin/forest /usr/local/bin/forest -# Expose ports for RPC -EXPOSE 1234 - CMD ["forest"]