File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed
Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change 11# syntax=docker/dockerfile:1
2- FROM rust:latest AS build
3- RUN apt update
4- RUN apt install -y s3cmd tar zstd awscli clang build-essential
5- RUN adduser --disabled-password --gecos "mutants" mutants
2+ FROM rust:latest AS base
3+ RUN apt update && apt dist-upgrade -y && apt install -y s3cmd tar zstd awscli clang build-essential
4+ RUN adduser --uid 1000 --disabled-password --gecos "mutants" mutants
65
7- USER mutants
6+ FROM base AS build
87WORKDIR /home/mutants
8+ USER mutants
9+ COPY --chown=mutants:mutants . mutants-src
10+ RUN --mount=type=cache,target=mutants-src/target,uid=1000 \
11+ --mount=type=cache,target=/home/mutants/.cargo,uid=1000 \
12+ cargo install -v --locked --path=mutants-src --root=buildroot
13+ RUN pwd && ls -la . buildroot
14+ RUN --mount=type=cache,target=/home/mutants/.cargo,uid=1000 \
15+ cargo install --locked cargo-nextest --root=buildroot
916
10- RUN cargo install --locked cargo-nextest
11- RUN --mount=type=bind,source=.,target=/src,rw cargo install --locked --path=/src
12-
13- # TODO: Copy everything to a final image that doesn't need the build artifacts?
14-
15- # FROM rust:latest AS final
16- # COPY --from=build /build/release/cargo-mutants /usr/local/bin/
17+ FROM base AS final
18+ USER mutants
19+ COPY --from=build /home/mutants/buildroot/bin/* /usr/local/bin/
You can’t perform that action at this time.
0 commit comments