Skip to content

Instantly share code, notes, and snippets.

@terry90
Last active June 15, 2018 13:40
Show Gist options
  • Save terry90/61eca5c3955335bcc560c9bdc90db828 to your computer and use it in GitHub Desktop.
Save terry90/61eca5c3955335bcc560c9bdc90db828 to your computer and use it in GitHub Desktop.
FROM rustlang/rust:nightly-slim as build
# Dependencies cache
WORKDIR /app/
COPY Cargo.toml .
COPY Cargo.lock .
RUN mkdir src
RUN echo "fn main() {}" > src/main.rs
RUN apt-get update && apt-get install -y pkg-config libssl-dev && apt-get clean
RUN cargo build --release
# End dependencies cache
COPY . .
RUN touch src/main.rs
RUN cargo test
RUN cargo build --release
FROM debian:jessie
WORKDIR /app/
RUN apt-get update && apt-get install -y openssl && apt-get clean
RUN apt-cache search ssl
COPY --from=build app/target/release/ox /ox
CMD ["/ox"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment