You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Use the official Rust image as the base imageFROM rust:latest as builder
# Create a new empty shell projectRUN USER=root cargo new --bin app
WORKDIR /app
# Copy our manifestsCOPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
# This build step will cache your dependenciesRUN cargo build --release
RUN rm src/*.rs
# Now that the dependencies are built, copy your source codeCOPY ./src ./src
# Build for release.# Touch the main file to force recompilation of the source code (in case it was changed)RUN touch src/main.rs && cargo build --release
# The final stage, which copies the binary from the "builder" stage and reduces the final image sizeFROM debian:buster-slim
COPY --from=builder /app/target/release/your-app-name .
# Set the command to run your binaryCMD ["./your-app-name"]
The text was updated successfully, but these errors were encountered:
Use something like this:
The text was updated successfully, but these errors were encountered: