Skip to content

Add --image flag for derived container images#43

Open
just-meng wants to merge 3 commits intocon:mainfrom
just-meng:enh-image-flag
Open

Add --image flag for derived container images#43
just-meng wants to merge 3 commits intocon:mainfrom
just-meng:enh-image-flag

Conversation

@just-meng
Copy link

Summary

  • Add --image=NAME flag to select derived container images
  • Add two example derived Dockerfiles: datalad and datalad-jj
  • Auto-detect and offer to build from images/Dockerfile.<suffix> on first use

Default behavior is unchangedyolo without --image uses con-bomination-claude-code as before.

Derived images

A short suffix maps to con-bomination-claude-code-<suffix>; full registry names (with / or :) are used as-is. Also configurable via YOLO_IMAGE
in .git/yolo/config.

Creating your own

  1. Add images/Dockerfile.<suffix> deriving from the base image:
    ARG BASE_IMAGE=con-bomination-claude-code
    FROM ${BASE_IMAGE}
    RUN <install your tools>
  2. Run yolo --image= — you'll be prompted to build on first use

Test plan

  • yolo (no flag) uses default con-bomination-claude-code
  • yolo --image=datalad-jj uses con-bomination-claude-code-datalad-jj
  • yolo --image=datalad with missing image prompts to build
  • yolo --image=nonexistent with no Dockerfile errors out
  • YOLO_IMAGE=datalad in config works; CLI overrides it
  • yolo --help shows the new option

🤖 Generated with https://claude.com/claude-code
EOF

just-meng and others added 3 commits February 18, 2026 17:16
DataLad-only derived image that adds datalad, datalad-next, and
datalad-container on top of the base con-bomination-claude-code image.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Derived image that adds DataLad (with datalad-next and datalad-container)
and Jujutsu (jj) version control on top of the base image.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add --image=NAME flag for choosing a derived container image. A short
suffix like "datalad-jj" maps to con-bomination-claude-code-datalad-jj;
names containing / or : are used as-is for registry images. Also
configurable via YOLO_IMAGE in .git/yolo/config (CLI takes precedence).

When a requested image doesn't exist locally, yolo looks for a matching
images/Dockerfile.<suffix> and offers to build it.

Default behavior is unchanged: without --image, yolo uses the base
con-bomination-claude-code image as before.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

# Install DataLad with useful extensions
RUN uv tool install --with datalad-container --with datalad-next datalad && \
uv cache clean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although I like modularity I really dislike duplication. And this example shows that combinatorics kick in early if you start thinking about datalad+something else. That is why we have in ./setup-yolo.sh

    --packages=PKGS         Extra apt packages to install in the container image
                            (comma or space-separated, requires rebuild)
    --extras=EXTRAS         Predefined extras to include (comma-separated):
                            cuda       - NVIDIA CUDA toolkit for building GPU extensions
                                         (experimental)
                            playwright - Playwright with Chromium for browser automation
                            all        - Enable all extras

It might be worth may be eventually if they keep coming to move out "extras" from the logic into something else, but I think for now it is better to add smth like --uv-tools-install and/or --extras datalad-next and jj which would add those predefined invocations you added. I do not think we should breed Dockerfile's here.

--image arg to specify the name for image to create/use could stay. Then we better though also allow for local to this repo .env of some kind which would define which image(s) you would like to build on the system. ATM I personally just rely on the CLI bash history to remember my invocation

./setup-yolo.sh --build=yes --packages="ffmpeg,imagemagick,yt-dlp,nodejs,podman,podman-compose,curl,tmux" --extras=playwright --install=yes

note that with uv I can then easily install datalad or what is needed (should be defined in project's pyproject.toml) thus isolating those requirements from the image overall.

Copy link
Member

@yarikoptic yarikoptic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants