Skip to content

Commit

Permalink
✨ Add docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Sep 23, 2023
1 parent 136f225 commit eaddf0d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -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
```
17 changes: 17 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions docker/cannon-rs.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine:3.14

COPY target/release/cannon /usr/local/bin

0 comments on commit eaddf0d

Please sign in to comment.