cargo-docker-build

Crates.iocargo-docker-build
lib.rscargo-docker-build
version0.1.2
sourcesrc
created_at2023-02-19 22:56:29.289552
updated_at2023-02-22 19:32:49.318114
descriptionBuild Dockerfile and script from Cargo.toml for a Rust workspace project
homepage
repositoryhttps://github.com/ovidiu-ionescu/docker-build
max_upload_size
id789363
size51,835
Ovidiu Ionescu (ovidiu-ionescu)

documentation

README

docker-build

Helps building the executables in a Rust workspace and deploy them inside minikube

It generates two files:

  • Dockerfile
  • build_docker.sh

When ran from the root of a workspace project, the program will read the Cargo.toml files from every subproject and create a multi stage Dockerfile, that can compile the sources and produce the images.
The ones with the name starting with lib will be ignored.

If the project is not a workspace, it will only generate for the current project.

The images will have labels with information extracted from Cargo.toml

A shell file build_docker.sh will be generated. When run, it will invoke the Dockerfile creation and will tag the newly created images using the labels in the images.

The program will only do the file generation, it will not run anything so you need to run the build_docker.sh manually.

Installation

This program is meant to run as a Cargo subcommand. To install it from source, run:

git clone git@github.com:ovidiu-ionescu/docker-build.git
cd docker-build
cargo install --path .
Commit count: 9

cargo fmt