Sign inSign up

wagtaildigital/chisel

By wagtaildigital

•Updated 2 days ago

This repository contains a minimal build for the canonical chisel application

Image
Security
Integration & delivery
Operating systems
0

10K+

wagtaildigital/chisel repository overview

⁠Chisel - Minimal Container Image Builder

A Docker image for Canonical's Chisel⁠, a powerful tool that creates minimal container images by cutting out unnecessary components from a base Ubuntu image.

⁠What is Chisel?

Chisel is a tool developed by Canonical that allows you to create minimal container images by selectively including only the components you need from a base Ubuntu image. This results in:

  • Smaller image sizes: Reduce your container footprint by including only what you need
  • Improved security: Fewer components mean a smaller attack surface
  • Faster deployments: Smaller images download and start faster
  • Reduced resource usage: Minimal images use less disk space and memory

⁠Supported Tags

  • latest: The most recent build of the image
  • hardened: The most recent hardened build
  • 1.5.1: Full version of Chisel
  • 1.5.1-hardened: Full version of Chisel with hardened configuration
  • 1.5.1-24.04: Specific Chisel version on specific Ubuntu version
  • 1.5.1-24.04-hardened: Hardened version for specific Chisel and Ubuntu versions

For a complete list of tags, see the Docker Hub Tags page⁠.

⁠Quick Start

# Pull the latest image
docker pull wagtaildigital/chisel:latest

# Run Chisel
docker run --rm wagtaildigital/chisel

# Create a minimal image with specific packages
docker run --rm --user "$(id -u):$(id -g)" -v $(pwd)/output:/rootfs wagtaildigital/chisel cut \
  --release ubuntu-24.04 \
  --root /rootfs \
  --arch amd64 \
  base-files_base \
  ca-certificates_data \
  bash_bins

⁠Usage Examples

⁠Creating a Minimal Base Image
# Create a directory for the output
mkdir -p my-minimal-image

# Run Chisel to create a minimal base image
docker run --rm --user "$(id -u):$(id -g)" -v $(pwd)/my-minimal-image:/rootfs wagtaildigital/chisel cut \
  --release ubuntu-24.04 \
  --root /rootfs \
  --arch amd64 \
  base-files_base \
  base-files_release-info \
  ca-certificates_data \
  libc6_libs \
  bash_bins \
  coreutils_bins

# Use the minimal image in a Dockerfile
cat > Dockerfile << EOF
FROM scratch
COPY my-minimal-image /
CMD ["/bin/bash"]
EOF

# Build your minimal image
docker build -t my-minimal-image .
⁠Using Chisel in a Multi-stage Build
# First stage: Use Chisel to create a minimal filesystem
FROM wagtaildigital/chisel:1.5.1 AS chisel
USER root
RUN mkdir -p /rootfs
RUN chisel cut --release ubuntu-24.04 --root /rootfs --arch amd64 \
    base-files_base \
    ca-certificates_data \
    libc6_libs \
    python3-minimal_bins \
    python3-minimal_libs

# Second stage: Create the final image from the minimal filesystem
FROM scratch
COPY --from=chisel /rootfs /
COPY ./app /app
WORKDIR /app
CMD ["python3", "app.py"]

⁠Configuration Options

The Docker image can be configured using the following build arguments:

ArgumentDescriptionDefault
OSBase operating systemubuntu
UBUNTU_VERSIONUbuntu version24.04
APP_VERSIONChisel git tag or branchv1.5.1
APP_REPOChisel repository URLhttps://github.com/canonical/chisel.git⁠
HARDENEDWhether to also publish -hardened tagstrue

⁠Troubleshooting

⁠Common Issues

Issue: Error when running Chisel: "failed to cut: no such package"
Solution: Make sure you're specifying valid package names. You can find available packages by running chisel list-slice-content.

Issue: Permission denied when writing to the output directory
Solution: Make sure the directory has the correct permissions or run the container with the appropriate user.

⁠License

This project is licensed under the MIT License.

⁠Source Code

The source code for this Docker image is available on GitHub⁠.

Tag summary

Content type

Image

Digest

sha256:0c72200ed…

Size

13.1 MB

Last updated

2 days ago

docker pull wagtaildigital/chisel