From 5aae39921c75ce59b084b82263a80bad527a6463 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Mon, 17 Jul 2023 20:01:51 -0400 Subject: [PATCH] Putting together docker image --- .dockerignore | 3 +++ Dockerfile | 8 +++++++- scripts/build_release_packages.sh | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 scripts/build_release_packages.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..aad1bca --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +/target +!/target/x86_64-unknown-linux-musl/release/protomask +/.github diff --git a/Dockerfile b/Dockerfile index 0a443d8..368141a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1 +1,7 @@ -# FROM \ No newline at end of file +FROM alpine:latest + +# Copy the binary from the builder container +COPY ./target/x86_64-unknown-linux-musl/release/protomask /usr/local/bin/protomask + +# NOTE: We expect the config file to be mounted at /etc/protomask.toml +ENTRYPOINT ["/usr/local/bin/protomask", "/etc/protomask.toml"] \ No newline at end of file diff --git a/scripts/build_release_packages.sh b/scripts/build_release_packages.sh new file mode 100644 index 0000000..fd87958 --- /dev/null +++ b/scripts/build_release_packages.sh @@ -0,0 +1,10 @@ +#! /bin/bash +# Builds everything needed for a new release +set -ex + +# Build RPM +cargo rpm build + +# Build Docker image +cross build --release --target x86_64-unknown-linux-musl +docker build -t ewpratten/protomask:latest .