本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)10k · #12024

docker

できること

このスキルは、研究や実験のコードを、ホストマシンから切り離されたDockerのコンテナの中で実行します。安全で再現できる実行を求める研究者向けです。

使う場面

  • ✓なじみのない論文のリポジトリのコードを、安全に実行したいとき。
  • ✓実験がパッケージのインストールやシステムの設定を変え、隔離されているべきとき。
  • ✓GPUやPythonの環境を、再現できる形で設定する必要があるとき。

スキルのリンク

https://github.com/Companion-Inc/feynman/blob/main/skills/docker/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/Companion-Inc/feynman/blob/main/skills/docker/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“この論文の学習のコードを、私のコンピューターの何も変えないように、Dockerのコンテナの中で実行してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このスキルは、プロジェクトのフォルダをコンテナにマウントし、そこで実験のコマンドを実行して、結果を同じフォルダに書き戻します。作業に合った基になるイメージを選びます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Docker Sandbox

Run research code inside Docker containers while Feynman stays on the host. The container gets the project files, runs the commands, and results sync back.

When to use

  • User selects "Docker Sandbox" as the execution environment in /replicate or /autoresearch
  • Running untrusted code from a paper's repository
  • Experiments that install packages or modify system state
  • Any time the user asks to run research code safely or isolated for a Feynman workflow

How it works

  1. Build or pull an appropriate base image for the research code
  2. Mount the project directory into the container
  3. Run experiment commands inside the container
  4. Results write back to the mounted directory

Running commands in a container

For Python research code (most common):

docker run --rm -v "$(pwd)":/workspace -w /workspace python:3.11 bash -c "
  pip install -r requirements.txt &&
  python train.py
"

For projects with a Dockerfile:

docker build -t feynman-experiment .
docker run --rm -v "$(pwd)/results":/workspace/results feynman-experiment

For GPU workloads:

docker run --rm --gpus all -v "$(pwd)":/workspace -w /workspace pytorch/pytorch:latest bash -c "
  pip install -r requirements.txt &&
  python train.py
"

Choosing the base image

Research type Base image
Python ML/DL pytorch/pytorch:latest or tensorflow/tensorflow:latest-gpu
Python general python:3.11
Node.js node:20
R / statistics rocker/r-ver:4
Julia julia:1.10
Multi-language ubuntu:24.04 with manual installs

Persistent containers

For iterative experiments (like /autoresearch), create a named container instead of --rm. Choose a descriptive name based on the experiment:

docker create --name <name> -v "$(pwd)":/workspace -w /workspace python:3.11 tail -f /dev/null
docker start <name>
docker exec <name> bash -c "pip install -r requirements.txt"
docker exec <name> bash -c "python train.py"

This preserves installed packages across iterations. Clean up with:

docker stop <name> && docker rm <name>

Notes

  • The mounted workspace syncs results back to the host automatically
  • Containers are network-enabled by default — add --network none for full isolation
  • For GPU access, Docker must be configured with the NVIDIA Container Toolkit
よくある質問

Dockerをインストールしておく必要がありますか?

はい。コマンドはDockerを使うため、あなたのマシンにインストールされている必要があります。

GPUを使えますか?

はい。GPUを必要とする作業のためのコマンドが含まれています。

結果はどこに行きますか?

マウントされたプロジェクトのフォルダに書き戻されるため、あなたのコンピューターで見ることができます。

詳細

作者による元の説明

Execute research code inside isolated Docker containers for safe replication, experiments, and benchmarks. Use when the user selects Docker as the execution environment or asks to run code safely, in isolation, or in a sandbox.

repo: Companion-Inc/feynman

人気

GitHubのスター
10k
ランキング
#12024
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル