diff options
author | kennycallado <kennycallado@gmail.com> | 2022-03-02 19:32:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-02 13:32:00 -0500 |
commit | 18d4a4c8a7c5060ed0f5094c958afe4f800e91d4 (patch) | |
tree | 0a41cf669f48bb818db05c4516407237bcb68936 | |
parent | 32ccec90bb41e83651a803229068007c6bb31a93 (diff) |
Add docker to build the binary and copy it to a clean busybox image (#149)
Co-authored-by: kennycallado <kennycallado@hotmail.com>
-rw-r--r-- | .Dockerignore | 9 | ||||
-rw-r--r-- | Dockerfile | 15 |
2 files changed, 24 insertions, 0 deletions
diff --git a/.Dockerignore b/.Dockerignore new file mode 100644 index 0000000..5f6b81f --- /dev/null +++ b/.Dockerignore @@ -0,0 +1,9 @@ +config +docs +target +Cargo.lock +Docker* +LICENSE +README.md +screenshot.png + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e439316 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM rust:latest AS builder + +COPY . /usr/src/joshuto + +WORKDIR /usr/src/joshuto + +RUN rustup target add x86_64-unknown-linux-musl \ + && cargo build --target x86_64-unknown-linux-musl --release + +FROM busybox:latest + +COPY target/x86_64-unknown-linux-musl/release/joshuto /bin/joshuto + +WORKDIR /root + |