Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)10k · #12024

docker

Skill này làm gì

Skill này chạy code nghiên cứu hoặc thử nghiệm bên trong container Docker, tách khỏi máy chủ. Skill dành cho nhà nghiên cứu muốn các lần chạy an toàn và lặp lại được.

Khi nào nên dùng

  • ✓Khi bạn muốn chạy code từ một kho bài báo lạ một cách an toàn.
  • ✓Khi một thử nghiệm cài đặt gói hoặc thay đổi cài đặt hệ thống và cần được cô lập.
  • ✓Khi bạn cần thiết lập môi trường GPU hoặc Python theo cách lặp lại được.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/Companion-Inc/feynman/blob/main/skills/docker/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chạy code huấn luyện của bài báo này trong một container Docker để nó không thay đổi gì trên máy tính của tôi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill gắn thư mục dự án vào container, chạy các lệnh thử nghiệm ở đó và ghi kết quả trở lại cùng thư mục. Skill chọn một image nền phù hợp cho công việc.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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
Câu hỏi thường gặp

Tôi có cần cài Docker không?

Có. Các lệnh dùng Docker nên phải được cài trên máy của bạn.

Skill có dùng được GPU không?

Có. Skill có một lệnh dành cho khối lượng công việc cần GPU.

Kết quả được ghi ở đâu?

Kết quả được ghi trở lại thư mục dự án đã gắn, để bạn thấy được trên máy tính của mình.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
10k
Vị trí xếp hạng
#12024
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự