Removing debug docker.

main
Heretic 7 months ago
parent 2377912264
commit c47bb52da6

8
Cargo.lock generated

@ -1508,18 +1508,18 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]] [[package]]
name = "zerocopy" name = "zerocopy"
version = "0.7.18" version = "0.7.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ede7d7c7970ca2215b8c1ccf4d4f354c4733201dfaaba72d44ae5b37472e4901" checksum = "dd66a62464e3ffd4e37bd09950c2b9dd6c4f8767380fabba0d523f9a775bc85a"
dependencies = [ dependencies = [
"zerocopy-derive", "zerocopy-derive",
] ]
[[package]] [[package]]
name = "zerocopy-derive" name = "zerocopy-derive"
version = "0.7.18" version = "0.7.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b27b1bb92570f989aac0ab7e9cbfbacdd65973f7ee920d9f0e71ebac878fd0b" checksum = "255c4596d41e6916ced49cfafea18727b24d67878fa180ddfd69b9df34fd1726"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",

@ -1,5 +1,4 @@
ARG RUST_VERSION=1.73 ARG RUST_VERSION=1.73
ARG RUST_RELEASE_MODE=debug
ARG DISTROLESS_IMAGE=gcr.io/distroless/cc-debian12 ARG DISTROLESS_IMAGE=gcr.io/distroless/cc-debian12
# Build the torrents.db file # Build the torrents.db file
@ -19,33 +18,21 @@ COPY ./src src
RUN cargo chef prepare --recipe-path recipe.json RUN cargo chef prepare --recipe-path recipe.json
FROM chef as builder FROM chef as builder
ARG RUST_RELEASE_MODE
COPY --from=planner /app/recipe.json ./recipe.json COPY --from=planner /app/recipe.json ./recipe.json
# Cargo chef cook # Cargo chef cook
RUN set -ex; \ RUN cargo chef cook --release --recipe-path recipe.json
if [ "${RUST_RELEASE_MODE}" = "debug" ]; then \
cargo chef cook --recipe-path recipe.json; \
else \
cargo chef cook --release --recipe-path recipe.json; \
fi
COPY ./Cargo.toml ./Cargo.lock ./ COPY ./Cargo.toml ./Cargo.lock ./
COPY ./src src COPY ./src src
# Cargo build # Cargo build
RUN set -ex; \ RUN cargo build --release
if [ "${RUST_RELEASE_MODE}" = "debug" ]; then \
cargo build; \
else \
cargo build --release; \
fi
# reduce binary size # reduce binary size
RUN strip ./target/$RUST_RELEASE_MODE/torrents-csv-service RUN strip ./target/release/torrents-csv-service
RUN cp ./target/$RUST_RELEASE_MODE/torrents-csv-service /app/torrents-csv-service RUN cp ./target/release/torrents-csv-service /app/torrents-csv-service
# The runner # The runner
FROM $DISTROLESS_IMAGE FROM $DISTROLESS_IMAGE

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# Rebuilding docker # Rebuilding docker
sudo docker build ../ --file Dockerfile --build-arg RUST_RELEASE_MODE=release -t torrents-csv-server:latest -t dessalines/torrents-csv-server:latest sudo docker build ../ --file Dockerfile -t torrents-csv-server:latest -t dessalines/torrents-csv-server:latest
sudo docker push dessalines/torrents-csv-server:latest sudo docker push dessalines/torrents-csv-server:latest
# SSH and pull it # SSH and pull it

Loading…
Cancel
Save