diff --git a/server/ops/docker/Cargo.toml b/server/ops/docker/Cargo.toml new file mode 100644 index 000000000..8fe91a83b --- /dev/null +++ b/server/ops/docker/Cargo.toml @@ -0,0 +1,17 @@ +# Specify svgbob_cli via Cargo.toml so that Dependabot can help with updates + +[package] +name = "kroki_svgbob_cli" +version = "0.1.0" +edition = "2021" + +[[bin]] +name = "svgbob_cli" +path = "/home/rust/.cargo/bin/svgbob" +test = false +bench = false + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +svgbob_cli = "0.5.3" diff --git a/server/ops/docker/build-static-svgbob b/server/ops/docker/build-static-svgbob index 7bcd6193e..4de6e44de 100644 --- a/server/ops/docker/build-static-svgbob +++ b/server/ops/docker/build-static-svgbob @@ -1,4 +1,9 @@ # build static executable binary FROM ekidd/rust-musl-builder:1.56.1 +COPY Cargo.toml . -RUN cargo install --quiet --version 0.5.3 svgbob_cli +RUN mkdir -p /home/rust/.cargo/bin/ +RUN cargo fetch --quiet + +# Copy the svgbob file to a consistent directory so that we can use it in the main kroki Dockerfile easily +RUN cp /home/rust/.cargo/registry/index/*/.cache/sv/gb/svgbob /home/rust/.cargo/bin/svgbob