From cbb52846c5b87c80fb14f525b19f6ef52b476a07 Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Mon, 12 Jun 2023 18:30:37 +0200 Subject: [PATCH] Update Dockerfile --- Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0203fae..d2de20c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /usr/src RUN USER=root cargo new app ## Install target platform (Cross-Compilation) --> Needed for Alpine -RUN rustup target add x86_64-unknown-linux-musl +#RUN rustup target add x86_64-unknown-linux-musl # We want dependencies cached, so copy those first. COPY Cargo.toml Cargo.lock /usr/src/app/ @@ -15,21 +15,23 @@ COPY Cargo.toml Cargo.lock /usr/src/app/ WORKDIR /usr/src/app # This is a dummy build to get the dependencies cached. -RUN cargo build --target x86_64-unknown-linux-musl --release +RUN cargo build --release +#--target x86_64-unknown-linux-musl # Now copy in the rest of the sources COPY src /usr/src/app/src/ RUN touch /usr/src/app/src/main.rs -RUN cargo build --target x86_64-unknown-linux-musl --release +RUN cargo build +#--target x86_64-unknown-linux-musl -FROM alpine:3.18 -COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/tcp-spawner /usr/local/bin +FROM debian:bookworm +COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-gnu/release/tcp-spawner /usr/local/bin EXPOSE 1337 LABEL org.opencontainers.image.source=https://github.com/danbulant/ctf-tcp-server LABEL org.opencontainers.image.description="A simple TCP process spawner written in Rust." -CMD ["tcp-spawner", "0.0.0.0:1337", "sh"] \ No newline at end of file +CMD ["tcp-spawner", "0.0.0.0:1337", "sh"]