fcc6921ddb
Fixes #27, or at least works around it. This deals with the issues mentioned in https://github.com/sgrif/pq-sys/pull/18, and it relies heavily on ideas from @golddranks and @clux.
25 lines
709 B
Docker
25 lines
709 B
Docker
# -*- mode: dockerfile -*-
|
|
#
|
|
# An example Dockerfile showing how to build a Rust executable using this
|
|
# image, and deploy it with a tiny Alpine Linux container.
|
|
|
|
# Our first FROM statement declares the build environment.
|
|
FROM ekidd/rust-musl-builder AS builder
|
|
|
|
# Add our source code.
|
|
ADD . ./
|
|
|
|
# Fix permissions on source code.
|
|
RUN sudo chown -R rust:rust /home/rust
|
|
|
|
# Build our application.
|
|
RUN cargo build --release
|
|
|
|
# Now, we need to build our _real_ Docker container, copying in `using-diesel`.
|
|
FROM alpine:latest
|
|
RUN apk --no-cache add ca-certificates
|
|
COPY --from=builder \
|
|
/home/rust/src/target/x86_64-unknown-linux-musl/release/using-diesel \
|
|
/usr/local/bin/
|
|
CMD /usr/local/bin/using-diesel
|