From d51c8ecafb3c8cfa7249c2de4ab206dd28d70e84 Mon Sep 17 00:00:00 2001 From: BAStos525 Date: Mon, 24 Jul 2023 18:52:13 +0300 Subject: [PATCH] [ci] #3654: Fix iroha2 glibc-based Dockerfiles to be deployed Signed-off-by: BAStos525 --- Dockerfile | 2 +- Dockerfile.build.glibc | 2 +- Dockerfile.glibc | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14e7c0a0dc8..67eed014e60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ RUN cargo build --target x86_64-unknown-linux-musl --features vendored --profile # final image -FROM alpine:3.16 +FROM alpine:3.18 ARG STORAGE=/storage ARG TARGET_DIR=/iroha/target/x86_64-unknown-linux-musl/deploy diff --git a/Dockerfile.build.glibc b/Dockerfile.build.glibc index 85bdb495976..5b9ee42d4b8 100644 --- a/Dockerfile.build.glibc +++ b/Dockerfile.build.glibc @@ -4,7 +4,7 @@ ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH -RUN pacman -Syu rustup mold openssl libgit2 git docker docker-buildx docker-compose --noconfirm +RUN pacman -Syu rustup mold openssl libgit2 git docker docker-buildx docker-compose glibc lib32-glibc --noconfirm RUN rustup toolchain install nightly-2023-06-25-x86_64-unknown-linux-gnu RUN rustup default nightly-2023-06-25-x86_64-unknown-linux-gnu diff --git a/Dockerfile.glibc b/Dockerfile.glibc index 1d6bbff8fd9..8c5e39b38d3 100644 --- a/Dockerfile.glibc +++ b/Dockerfile.glibc @@ -24,6 +24,8 @@ RUN mold --run cargo build --target x86_64-unknown-linux-gnu --profile deploy # final image FROM alpine:3.18 +ENV GLIBC_REPO=https://github.com/sgerrand/alpine-pkg-glibc +ENV GLIBC_VERSION=2.35-r1 ARG STORAGE=/storage ARG TARGET_DIR=/iroha/target/x86_64-unknown-linux-gnu/deploy ENV BIN_PATH=/usr/local/bin/ @@ -33,7 +35,12 @@ ENV IROHA2_GENESIS_PATH=$CONFIG_DIR/genesis.json ENV KURA_BLOCK_STORE_PATH=$STORAGE RUN set -ex && \ - apk --update add curl ca-certificates && \ + apk --update add libstdc++ curl ca-certificates gcompat && \ + for pkg in glibc-${GLIBC_VERSION} glibc-bin-${GLIBC_VERSION}; \ + do curl -sSL ${GLIBC_REPO}/releases/download/${GLIBC_VERSION}/${pkg}.apk -o /tmp/${pkg}.apk; done && \ + apk add --force-overwrite --allow-untrusted /tmp/*.apk && \ + rm -v /tmp/*.apk && \ + /usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib && \ adduser --disabled-password iroha --shell /bin/bash --home /app && \ mkdir -p $CONFIG_DIR && \ mkdir $STORAGE && \