Docker Environment Setup
БесплатноБез исполняемых скриптовНе проверенSet up a Docker container for running Nextflow training examples. Handles basic setup, Docker-outside-of-Docker (DooD) for containerized processes, ARM Mac…
Об этом скилле
Docker Environment Setup
Set up a Docker container environment for running Nextflow training examples. This skill handles all Docker configuration needed to match the Codespaces/Gitpod environment that learners use.
Initial Questions
Use AskUserQuestion to determine the setup type:
Which Docker setup do you need?
- Basic setup (Recommended) - For tutorials without containerized processes (e.g., hello_nextflow basics, plugin_development)
- DooD setup - For tutorials with containerized processes (e.g., genomics, essential_scripting_patterns)
- Check/restart existing - Verify or restart an existing nf-training container
Determine NXF_VER and training image
Before any Docker commands, read the Nextflow version and the training image reference from devcontainer.json:
NXF_VER=$(grep -o '"NXF_VER":\s*"[^"]*"' .devcontainer/devcontainer.json | cut -d'"' -f4)
TRAINING_IMAGE=$(grep -o '"image":\s*"[^"]*"' .devcontainer/devcontainer.json | cut -d'"' -f4)
echo "Using NXF_VER=${NXF_VER}, TRAINING_IMAGE=${TRAINING_IMAGE}"
Always use ${TRAINING_IMAGE} as read from the currently checked-out branch's devcontainer.json — do not hardcode ghcr.io/nextflow-io/training:latest. The tag a branch pins is the version that corresponds to what that branch's docs were written/tested against; pulling whatever the registry's latest tag happens to be right now can silently diverge from it. Pull that exact reference (docker pull "${TRAINING_IMAGE}") before starting the container, so a stale local cache doesn't ship an outdated image under the same tag name — but never substitute a different tag than what the branch declares.
Basic Setup
For tutorials that don't use containerized processes:
# Clean up any existing container
docker stop nf-training 2>/dev/null; docker rm nf-training 2>/dev/null
# Read the image reference pinned by this branch's devcontainer.json and pull it
NXF_VER=$(grep -o '"NXF_VER":\s*"[^"]*"' .devcontainer/devcontainer.json | cut -d'"' -f4)
TRAINING_IMAGE=$(grep -o '"image":\s*"[^"]*"' .devcontainer/devcontainer.json | cut -d'"' -f4)
docker pull "${TRAINING_IMAGE}"
# Start fresh container with UTF-8 locale support
docker run -d --name nf-training \
-e NXF_VER=${NXF_VER} \
-e LANG=C.UTF-8 \
-e LC_ALL=C.UTF-8 \
-v "${PWD}:/workspaces/training" \
-w /workspaces/training \
"${TRAINING_IMAGE}" \
sleep infinity
Important: The LANG=C.UTF-8 and LC_ALL=C.UTF-8 environment variables are critical for handling non-ASCII characters (like "Holà", "Grüß Gott") in file names and content.
Running Commands
docker exec -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 \
-w /workspaces/training/<working-dir> \
nf-training \
<command>
Docker-outside-of-Docker (DooD) Setup
For tutorials with containerized processes (FASTP, BWA, SAMTOOLS, etc.):
# Clean up any existing container
docker stop nf-training 2>/dev/null; docker rm nf-training 2>/dev/null
# Read the image reference pinned by this branch's devcontainer.json and pull it
NXF_VER=$(grep -o '"NXF_VER":\s*"[^"]*"' .devcontainer/devcontainer.json | cut -d'"' -f4)
TRAINING_IMAGE=$(grep -o '"image":\s*"[^"]*"' .devcontainer/devcontainer.json | cut -d'"' -f4)
HOST_PATH="${PWD}"
docker pull "${TRAINING_IMAGE}"
# Start container with DooD support
docker run -d --name nf-training \
-e NXF_VER=${NXF_VER} \
-e LANG=C.UTF-8 \
-e LC_ALL=C.UTF-8 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "${HOST_PATH}:${HOST_PATH}" \
-w "${HOST_PATH}" \
"${TRAINING_IMAGE}" \
sleep infinity
# Create symlink for Codespaces paths
docker exec nf-training bash -c "rm -rf /workspaces/training && mkdir -p /workspaces && ln -sf ${HOST_PATH} /workspaces/training"
Critical differences from basic setup:
- Docker socket mount (
-v /var/run/docker.sock:/var/run/docker.sock) - Allows Nextflow to spawn sibling containers - Matching host paths (
-v "${HOST_PATH}:${HOST_PATH}") - Work directories resolve correctly between containers - Symlink - Makes
/workspaces/training/...paths work locally
Running Commands with DooD
docker exec -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 -e USER=testuser \
-w "${HOST_PATH}/<working-dir>" \
nf-training \
nextflow run <script.nf> [options]
When DooD is Needed
Any tutorial where processes specify containers:
hello_nextflow(later lessons with containers)nf4_science/genomicsand other domain modules- Side quests:
essential_scripting_patterns,metadata, etc.
Apple Silicon (ARM) Macs
Most bioinformatics containers are built for x86_64/amd64. On ARM Macs, create a platform config:
docker exec nf-training bash -c 'cat > /tmp/platform.config << EOF
docker.runOptions = "--platform linux/amd64"
EOF'
Include when running:
docker exec -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 -e USER=testuser \
-w "${HOST_PATH}/<working-dir>" \
nf-training \
nextflow
Установить Docker Environment Setup в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Docker Environment Setup?
Set up a Docker container for running Nextflow training examples. Handles basic setup, Docker-outside-of-Docker (DooD) for containerized processes, ARM Mac platform emulation, and troubleshooting. Use when you need to run Nextflow examples in a consistent environment.
Как установить скилл Docker Environment Setup?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Docker Environment Setup запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub