Skip to content

Instantly share code, notes, and snippets.

@gugahoa
Created December 11, 2018 20:16
Show Gist options
  • Save gugahoa/6e67d8b1a535b0729c3da62fe305d1aa to your computer and use it in GitHub Desktop.
Save gugahoa/6e67d8b1a535b0729c3da62fe305d1aa to your computer and use it in GitHub Desktop.
FROM rust_base:latest
COPY src/ .
RUN cargo build
FROM rust:latest
RUN mkdir /opt/project_root -p
WORKDIR /opt/project_root
RUN useradd builder
RUN chown builder:builder /opt/project_root
USER builder
RUN USER=builder cargo init
COPY Cargo.toml .
RUN cargo fetch
RUN cargo build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment