Skip to content

Commit

Permalink
[feature] #4083: Add build args to Dockerfile.glibc
Browse files Browse the repository at this point in the history
Signed-off-by: Shanin Roman <[email protected]>
  • Loading branch information
Erigara committed Jan 23, 2024
1 parent 4e6e24c commit 1254c19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
**/target
Dockerfile
Dockerfile*
15 changes: 6 additions & 9 deletions Dockerfile.glibc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down

0 comments on commit 1254c19

Please sign in to comment.