Skip to content

Commit

Permalink
Added comments into dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantinzolotarev committed Apr 12, 2024
1 parent d9f2c2d commit b305c14
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
# syntax=docker/dockerfile:1.4

FROM rust:alpine3.19 as build-environment

ARG TARGETARCH
WORKDIR /opt

RUN apk add lld build-base linux-headers pkgconf openssl-dev
# RUN apk add clang lld curl build-base linux-headers git pkgconf openssl-dev \
# && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh \
# && chmod +x ./rustup.sh \
# && ./rustup.sh -y

RUN echo "export RUSTFLAGS='-Ctarget-feature=-crt-static'" >> $HOME/.profile
# Mac M1 workaround
RUN [[ "$TARGETARCH" = "arm64" ]] && echo "export CFLAGS=-mno-outline-atomics" >> $HOME/.profile || true

WORKDIR /opt/challenger
COPY . .

RUN --mount=type=cache,target=/root/.cargo/registry --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/opt/challenger/target \
RUN --mount=type=cache,target=/root/.cargo/registry \
--mount=type=cache,target=/root/.cargo/git \
--mount=type=cache,target=/opt/challenger/target \
source $HOME/.profile \
&& cargo build --release \
&& mkdir out \
&& mv target/release/challenger out/challenger \
&& strip out/challenger;

# Runner image
FROM alpine:3.19 as challenger-client

RUN apk add --no-cache linux-headers gcompat libgcc
Expand Down

0 comments on commit b305c14

Please sign in to comment.