Skip to content

mbround18/docker-cargo-make

Repository files navigation

docker-cargo-make

Docker Pulls GitHub Release License: Unlicense

A lightweight Docker image containing cargo-make, a powerful build tool and task runner for Rust projects. This container provides an easy way to use cargo-make in CI/CD pipelines and development environments without local installation.

Features

  • 🚀 Pre-built cargo-make binary ready to use
  • 🐳 Minimal Docker image for efficient CI/CD
  • 🔄 Automated synchronization with cargo-make releases
  • 📦 Multi-architecture support

Quick Start

Using in Dockerfile

FROM rust:1.88 as builder
WORKDIR /app
COPY . .
COPY --from=mbround18/cargo-make /usr/local/bin/cargo-make /usr/local/cargo/bin/
RUN cargo make build

Running Directly

# Pull and run a specific version
docker run --rm mbround18/cargo-make:0.37.20 cargo make --version

# Run cargo-make commands directly
docker run --rm -v $(pwd):/workspace -w /workspace mbround18/cargo-make cargo make build

# Interactive shell with cargo-make available
docker run --rm -it -v $(pwd):/workspace -w /workspace mbround18/cargo-make sh

Examples

Basic Build Task

FROM mbround18/cargo-make:latest as make
FROM rust:1.88 as builder

WORKDIR /app
COPY . .
COPY --from=make /usr/local/bin/cargo-make /usr/local/cargo/bin/

RUN cargo make ci-flow

Multi-stage Build with Tests

FROM mbround18/cargo-make:latest as make
FROM rust:1.88 as builder

WORKDIR /app
COPY . .
COPY --from=make /usr/local/bin/cargo-make /usr/local/cargo/bin/

# Run tests and build
RUN cargo make test
RUN cargo make build --release

FROM debian:bookworm-slim
COPY --from=builder /app/target/release/myapp /usr/local/bin/
CMD ["myapp"]

Contributing

Contributions are welcome! This repository includes automation tools for maintaining Docker images and syncing with cargo-make releases.

For development setup, available commands, and contribution guidelines, please see Code of Conduct

For issues related to cargo-make functionality, please report them to the cargo-make repository.

For issues specific to this Docker container, please use this repository's issue tracker.

License

This project is released into the public domain under The Unlicense - see the LICENSE file for details.

References

About

Bundle Cargo & Cargo Make into a docker file for easy CI use or to use in dockerfiles.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors