Skip to content

Commit

Permalink
Use cargo.toml to install svgbob
Browse files Browse the repository at this point in the history
  • Loading branch information
ssaraswati committed Aug 26, 2022
1 parent b277a2d commit efe7d10
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
17 changes: 17 additions & 0 deletions server/ops/docker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
7 changes: 6 additions & 1 deletion server/ops/docker/build-static-svgbob
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit efe7d10

Please sign in to comment.