File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,14 +16,14 @@ RUN rustup target add x86_64-unknown-linux-musl
1616WORKDIR /redlib
1717
1818# download (most) dependencies in their own layer
19- COPY Cargo.lock Cargo.toml ./
19+ COPY Cargo.lock Cargo.toml build.rs ./
2020RUN mkdir src && echo "fn main() { panic!(\"why am i running?\") }" > src/main.rs
2121RUN cargo build --release --locked --bin redlib --target x86_64-unknown-linux-musl
2222RUN rm ./src/main.rs && rmdir ./src
2323
2424# copy the source and build the redlib binary
2525COPY . ./
26- RUN cargo build --release --locked --bin redlib --target x86_64-unknown-linux-musl
26+ RUN touch src/main.rs && cargo build --release --locked --bin redlib --target x86_64-unknown-linux-musl
2727RUN echo "finished building redlib!"
2828
2929########################
Original file line number Diff line number Diff line change @@ -14,21 +14,25 @@ RUN apt-get update \
1414WORKDIR /redlib
1515
1616# download (most) dependencies in their own layer
17- COPY Cargo.lock Cargo.toml ./
17+ COPY Cargo.lock Cargo.toml build.rs ./
1818RUN mkdir src && echo "fn main() { panic!(\"why am i running?\") }" > src/main.rs
1919RUN cargo build --release --locked --bin redlib
2020RUN rm ./src/main.rs && rmdir ./src
2121
2222# copy the source and build the redlib binary
2323COPY . ./
24- RUN cargo build --release --locked --bin redlib
24+ RUN touch src/main.rs && cargo build --release --locked --bin redlib
2525RUN echo "finished building redlib!"
2626
2727########################
2828## release image
2929########################
3030FROM ubuntu:${UBUNTU_RELEASE_VERSION} AS release
3131
32+ # Install ca-certificates
33+ RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
34+ && rm -rf /var/lib/apt/lists/*
35+
3236# Import redlib binary from builder
3337COPY --from=builder /redlib/target/release/redlib /usr/local/bin/redlib
3438
You can’t perform that action at this time.
0 commit comments