Skip to content

dockerized app just outputs Hello, world! and exits. #2517

Discussion options

You must be logged in to vote

Here's a Dockerfile that I recommend using as a template:

FROM docker.io/rust:1.68.2-slim-bullseye AS builder

WORKDIR /build

COPY . .
RUN --mount=type=cache,target=/build/target \
    --mount=type=cache,target=/usr/local/cargo/registry \
    --mount=type=cache,target=/usr/local/cargo/git \
    --mount=type=cache,target=/usr/local/rustup \
    set -eux; \
	rustup install stable; \
    cargo build --release; \
    objcopy --compress-debug-sections target/release/server ./server

################################################################################

FROM docker.io/debian:bullseye-slim

WORKDIR /app

COPY --from=builder /build/server ./server
CMD ROCKET_ADDRESS=0.0.0.0 ROCKET_POR…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@olekspickle
Comment options

Answer selected by olekspickle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants