Create docker image for release

This commit is contained in:
Pierre HUBERT 2022-10-16 14:36:57 +02:00
parent f2ec85b46f
commit 4501be6a43
2 changed files with 16 additions and 0 deletions

6
rust/Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM debian:bullseye-slim
COPY sea_battle_backend /usr/local/bin/sea_battle_backend
ENTRYPOINT /usr/local/bin/sea_battle_backend

10
rust/build_docker_image.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
cargo build --release --bins
TEMP_DIR=$(mktemp -d)
cp target/release/sea_battle_backend "$TEMP_DIR"
docker build -f Dockerfile "$TEMP_DIR" -t pierre42100/seabattleapi
rm -r $TEMP_DIR