From 34190eab0ffbab13567cce40a35bbe7c6d0374cd Mon Sep 17 00:00:00 2001 From: Arvid Jakobsson Date: Thu, 22 Sep 2022 08:37:50 +0200 Subject: [PATCH] Docker: add active protocol parameters --- Dockerfile | 2 ++ build.Dockerfile | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6291805fc5ab..cff4c70d0e9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,8 @@ COPY --chown=tezos:nogroup --from=builder /home/tezos/tezos/tezos-signer /home/t COPY --chown=tezos:nogroup --from=builder /home/tezos/tezos/tezos-tx-rollup-* /home/tezos/bin/ COPY --chown=tezos:nogroup --from=builder /home/tezos/tezos/tezos-sc-rollup-* /home/tezos/bin/ COPY --chown=tezos:nogroup --from=builder /home/tezos/tezos/tezos-codec /home/tezos/bin/ +# Add parameters for active protocols +COPY --chown=tezos:nogroup --from=builder /home/tezos/tezos/parameters /home/tezos/scripts/ # Add entrypoint scripts COPY --chown=tezos:nogroup scripts/docker/entrypoint.* /home/tezos/bin/ # Add scripts diff --git a/build.Dockerfile b/build.Dockerfile index 825051a03245..d5d90c682e34 100644 --- a/build.Dockerfile +++ b/build.Dockerfile @@ -1,12 +1,15 @@ ARG BASE_IMAGE=registry.gitlab.com/tezos/opam-repository ARG BASE_IMAGE_VERSION FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION} +# use alpine /bin/ash and set pipefail. +# see https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run +SHELL ["/bin/ash", "-o", "pipefail", "-c"] # do not move the ARG below above the FROM or it gets erased ARG GIT_SHORTREF ARG GIT_DATETIME ARG GIT_VERSION WORKDIR /home/tezos -RUN mkdir -p /home/tezos/tezos/scripts /home/tezos/tezos/script-inputs +RUN mkdir -p /home/tezos/tezos/scripts /home/tezos/tezos/script-inputs /home/tezos/tezos/parameters COPY --chown=tezos:nogroup Makefile tezos COPY --chown=tezos:nogroup script-inputs/active_protocol_versions tezos/script-inputs/ COPY --chown=tezos:nogroup script-inputs/tx_rollup_protocol_versions tezos/script-inputs/ @@ -23,3 +26,8 @@ ENV GIT_SHORTREF=${GIT_SHORTREF} ENV GIT_DATETIME=${GIT_DATETIME} ENV GIT_VERSION=${GIT_VERSION} RUN opam exec -- make -C tezos release +# Gather the parameters of all active protocols in 1 place +RUN while read -r protocol; do \ + mkdir -p tezos/parameters/"$protocol"-parameters && \ + cp tezos/src/proto_"$(echo "$protocol" | tr - _)"/parameters/*.json tezos/parameters/"$protocol"-parameters; \ + done < tezos/script-inputs/active_protocol_versions -- GitLab