Add files to produce Docker container
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
45651ed313
commit
a0e276a629
2 changed files with 25 additions and 0 deletions
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
target
|
||||||
|
|
23
Dockerfile
Normal file
23
Dockerfile
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
FROM rust:1.65-buster as builder
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y libssl-dev pkg-config
|
||||||
|
|
||||||
|
WORKDIR /srv
|
||||||
|
|
||||||
|
# Build dependencies and cache them
|
||||||
|
COPY Cargo.* ./
|
||||||
|
RUN mkdir -p src && \
|
||||||
|
echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs && \
|
||||||
|
cargo build --release && \
|
||||||
|
rm -r src && \
|
||||||
|
rm target/release/deps/d53*
|
||||||
|
|
||||||
|
# Build final app
|
||||||
|
COPY ./src ./src
|
||||||
|
RUN cargo build --release
|
||||||
|
|
||||||
|
FROM debian:bullseye-slim
|
||||||
|
RUN apt-get update && apt-get install -y libssl1.1 iptables ca-certificates
|
||||||
|
COPY --from=builder /srv/target/release/d53 /usr/local/sbin/d53
|
||||||
|
CMD ["/usr/local/sbin/d53"]
|
Loading…
Reference in a new issue