diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..ed797f5 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,11 @@ +# `cannon-rs` Docker + +This folder contains the Dockerfile for the `cannon-rs` binary. + +## Building + +Dependencies: [Docker](https://www.docker.com/) + +```sh +./build.sh +``` diff --git a/docker/build.sh b/docker/build.sh new file mode 100755 index 0000000..4777070 --- /dev/null +++ b/docker/build.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Grab the directory of this script. +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +echo "Building binary..." +cargo build --release --bin cannon + +# Check if `docker` is installed +if ! command -v docker &> /dev/null +then + echo "Error: docker not found. Please install docker and try again." + exit +fi + +echo "Building image..." +docker build -f cannon-rs.dockerfile $DIR/.. -t cannon-rs diff --git a/docker/cannon-rs.dockerfile b/docker/cannon-rs.dockerfile new file mode 100644 index 0000000..72550c3 --- /dev/null +++ b/docker/cannon-rs.dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.14 + +COPY target/release/cannon /usr/local/bin