diff --git a/.dockerignore b/.dockerignore index aae0c8a6f9d..978a5b26769 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,2 @@ **/target -Dockerfile +Dockerfile* diff --git a/Dockerfile.glibc b/Dockerfile.glibc index 25eb2e0068a..11a5b5e0659 100644 --- a/Dockerfile.glibc +++ b/Dockerfile.glibc @@ -19,15 +19,16 @@ RUN rustup component add rust-src # builder stage WORKDIR /iroha COPY . . -RUN mold --run cargo build --target x86_64-unknown-linux-gnu --profile deploy +ARG PROFILE="deploy" +ARG RUSTFLAGS="" +RUN RUSTFLAGS="-C target-feature=+crt-static ${RUSTFLAGS}" mold --run cargo build --target x86_64-unknown-linux-gnu --profile "${PROFILE}" # final image FROM alpine:3.18 -ENV GLIBC_REPO=https://github.com/sgerrand/alpine-pkg-glibc -ENV GLIBC_VERSION=2.35-r1 +ARG PROFILE="deploy" ARG STORAGE=/storage -ARG TARGET_DIR=/iroha/target/x86_64-unknown-linux-gnu/deploy +ARG TARGET_DIR=/iroha/target/x86_64-unknown-linux-gnu/${PROFILE} ENV BIN_PATH=/usr/local/bin/ ENV CONFIG_DIR=/config ENV IROHA2_CONFIG_PATH=$CONFIG_DIR/config.json @@ -39,11 +40,7 @@ ENV UID=1001 ENV GID=1001 RUN set -ex && \ - 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 && \ + apk --update add curl ca-certificates gcompat && \ addgroup -g $GID $USER && \ adduser \ --disabled-password \