diff --git a/.gitignore b/.gitignore index 1667cd1..c7aaab1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.idea +/docker/linux /target **/*.rs.bk rsddns.yml diff --git a/docker/build-linux.bat b/docker/build-linux.bat new file mode 100644 index 0000000..a52d538 --- /dev/null +++ b/docker/build-linux.bat @@ -0,0 +1,11 @@ +if not exist "%cd%\docker\linux\target" mkdir "%cd%\docker\linux\target" +if not exist "%cd%\docker\linux\cargo" mkdir "%cd%\docker\linux\cargo" + +docker run --rm ^ +-e CARGO_HOME="/tmp/cargo" ^ +-v "%cd%":/usr/src/rsddns ^ +-v "%cd%\docker\linux\target":/usr/src/rsddns/target ^ +-v "%cd%\docker\linux\cargo":/tmp/cargo ^ +-w /usr/src/rsddns ^ +rust:1.30.1-stretch ^ +cargo build --release && strip $/usr/src/rsddns/target/release/rsddns \ No newline at end of file diff --git a/docker/run-linux.bat b/docker/run-linux.bat new file mode 100644 index 0000000..ea27a4f --- /dev/null +++ b/docker/run-linux.bat @@ -0,0 +1,8 @@ +copy rsddns.yml "%cd%\docker\linux\target\release\rsddns.yml" + +docker run --rm -i -t ^ +-p 8080:8080 ^ +-v "%cd%\docker\linux\target\release":/opt/rsddns ^ +-w /opt/rsddns ^ +debian:stretch-slim ^ +./rsddns -c ./rsddns.yml -h 0.0.0.0 -p 8080 \ No newline at end of file