Kaynağa Gözat

Merge pull request #37 from Yannig/dockerfile

Dockerfile to build dog using Docker.
Benjamin Sago 4 yıl önce
ebeveyn
işleme
c1372ac29b
2 değiştirilmiş dosya ile 31 ekleme ve 0 silme
  1. 18 0
      Dockerfile
  2. 13 0
      README.md

+ 18 - 0
Dockerfile

@@ -0,0 +1,18 @@
+FROM rust as build
+
+WORKDIR /build
+COPY /src /build/src
+COPY /dns /build/dns
+COPY /dns-transport /build/dns-transport
+COPY /man /build/man
+COPY build.rs Cargo.toml /build/
+
+RUN cargo build --release
+
+FROM debian:buster-slim
+
+RUN apt update && apt install libssl1.1 && apt clean all
+
+COPY --from=build /build/target/release/dog /dog
+
+ENTRYPOINT ["/dog"]

+ 13 - 0
README.md

@@ -104,6 +104,19 @@ The `just man` command will compile the Markdown into manual pages, which it wil
 To use them, copy them into a directory that `man` will read.
 `/usr/local/share/man` is usually a good choice.
 
+### Container image
+
+To build the container image of dog, you can use Docker or Kaniko. Here an example using Docker:
+
+    $ docker build -t dog .
+
+You can then run it using the following command:
+
+    $ docker run -it --rm dog
+
+To run dog directly, you can then define the following alias:
+
+    $ alias dog="docker run -it --rm dog"
 
 ### Testing