mirror of
https://github.com/danbulant/ctf-tcp-server
synced 2026-07-05 02:50:44 +00:00
Update Dockerfile
This commit is contained in:
parent
905e44ce8f
commit
cbb52846c5
1 changed files with 8 additions and 6 deletions
12
Dockerfile
12
Dockerfile
|
|
@ -6,7 +6,7 @@ WORKDIR /usr/src
|
||||||
RUN USER=root cargo new app
|
RUN USER=root cargo new app
|
||||||
|
|
||||||
## Install target platform (Cross-Compilation) --> Needed for Alpine
|
## 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.
|
# We want dependencies cached, so copy those first.
|
||||||
COPY Cargo.toml Cargo.lock /usr/src/app/
|
COPY Cargo.toml Cargo.lock /usr/src/app/
|
||||||
|
|
@ -15,17 +15,19 @@ COPY Cargo.toml Cargo.lock /usr/src/app/
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# This is a dummy build to get the dependencies cached.
|
# 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
|
# Now copy in the rest of the sources
|
||||||
COPY src /usr/src/app/src/
|
COPY src /usr/src/app/src/
|
||||||
|
|
||||||
RUN touch /usr/src/app/src/main.rs
|
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
|
FROM debian:bookworm
|
||||||
COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/tcp-spawner /usr/local/bin
|
COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-gnu/release/tcp-spawner /usr/local/bin
|
||||||
|
|
||||||
EXPOSE 1337
|
EXPOSE 1337
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue