jpskill.com
💼 ビジネス コミュニティ 🟡 少し慣れが必要 👤 経営者・事業責任者・マーケ

💼 Docker Essentials

docker-essentials

Dockerの基本的な操作方法や作業の流れを学び、

⏱ 議事録 30分 → 3分

📺 まず動画で見る(YouTube)

▶ 【自動化】AIガチ勢の最新活用術6選がこれ1本で丸分かり!【ClaudeCode・AIエージェント・AI経営・Skills・MCP】 ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Essential Docker commands and workflows for container management, image operations, and debugging.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Dockerの基本的な操作方法や作業の流れを学び、

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o docker-essentials.zip https://jpskill.com/download/4736.zip && unzip -o docker-essentials.zip && rm docker-essentials.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/4736.zip -OutFile "$d\docker-essentials.zip"; Expand-Archive "$d\docker-essentials.zip" -DestinationPath $d -Force; ri "$d\docker-essentials.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して docker-essentials.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → docker-essentials フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • Docker Essentials で、私のビジネスを分析して改善案を3つ提案して
  • Docker Essentials を使って、来週の会議用の資料を作って
  • Docker Essentials で、現状の課題を整理してアクションプランに落として

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Claude が読む原文 SKILL.md(中身を展開)

この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。

Docker Essentials

Essential Docker commands for container and image management.

Container Lifecycle

Running containers

# Run container from image
docker run nginx

# Run in background (detached)
docker run -d nginx

# Run with name
docker run --name my-nginx -d nginx

# Run with port mapping
docker run -p 8080:80 -d nginx

# Run with environment variables
docker run -e MY_VAR=value -d app

# Run with volume mount
docker run -v /host/path:/container/path -d app

# Run with auto-remove on exit
docker run --rm alpine echo "Hello"

# Interactive terminal
docker run -it ubuntu bash

Managing containers

# List running containers
docker ps

# List all containers (including stopped)
docker ps -a

# Stop container
docker stop container_name

# Start stopped container
docker start container_name

# Restart container
docker restart container_name

# Remove container
docker rm container_name

# Force remove running container
docker rm -f container_name

# Remove all stopped containers
docker container prune

Container Inspection & Debugging

Viewing logs

# Show logs
docker logs container_name

# Follow logs (like tail -f)
docker logs -f container_name

# Last 100 lines
docker logs --tail 100 container_name

# Logs with timestamps
docker logs -t container_name

Executing commands

# Execute command in running container
docker exec container_name ls -la

# Interactive shell
docker exec -it container_name bash

# Execute as specific user
docker exec -u root -it container_name bash

# Execute with environment variable
docker exec -e VAR=value container_name env

Inspection

# Inspect container details
docker inspect container_name

# Get specific field (JSON path)
docker inspect -f '{{.NetworkSettings.IPAddress}}' container_name

# View container stats
docker stats

# View specific container stats
docker stats container_name

# View processes in container
docker top container_name

Image Management

Building images

# Build from Dockerfile
docker build -t myapp:1.0 .

# Build with custom Dockerfile
docker build -f Dockerfile.dev -t myapp:dev .

# Build with build args
docker build --build-arg VERSION=1.0 -t myapp .

# Build without cache
docker build --no-cache -t myapp .

Managing images

# List images
docker images

# Pull image from registry
docker pull nginx:latest

# Tag image
docker tag myapp:1.0 myapp:latest

# Push to registry
docker push myrepo/myapp:1.0

# Remove image
docker rmi image_name

# Remove unused images
docker image prune

# Remove all unused images
docker image prune -a

Docker Compose

Basic operations

# Start services
docker-compose up

# Start in background
docker-compose up -d

# Stop services
docker-compose down

# Stop and remove volumes
docker-compose down -v

# View logs
docker-compose logs

# Follow logs for specific service
docker-compose logs -f web

# Scale service
docker-compose up -d --scale web=3

Service management

# List services
docker-compose ps

# Execute command in service
docker-compose exec web bash

# Restart service
docker-compose restart web

# Rebuild service
docker-compose build web

# Rebuild and restart
docker-compose up -d --build

Networking

# List networks
docker network ls

# Create network
docker network create mynetwork

# Connect container to network
docker network connect mynetwork container_name

# Disconnect from network
docker network disconnect mynetwork container_name

# Inspect network
docker network inspect mynetwork

# Remove network
docker network rm mynetwork

Volumes

# List volumes
docker volume ls

# Create volume
docker volume create myvolume

# Inspect volume
docker volume inspect myvolume

# Remove volume
docker volume rm myvolume

# Remove unused volumes
docker volume prune

# Run with volume
docker run -v myvolume:/data -d app

System Management

# View disk usage
docker system df

# Clean up everything unused
docker system prune

# Clean up including unused images
docker system prune -a

# Clean up including volumes
docker system prune --volumes

# Show Docker info
docker info

# Show Docker version
docker version

Common Workflows

Development container:

docker run -it --rm \
  -v $(pwd):/app \
  -w /app \
  -p 3000:3000 \
  node:18 \
  npm run dev

Database container:

docker run -d \
  --name postgres \
  -e POSTGRES_PASSWORD=secret \
  -e POSTGRES_DB=mydb \
  -v postgres-data:/var/lib/postgresql/data \
  -p 5432:5432 \
  postgres:15

Quick debugging:

# Shell into running container
docker exec -it container_name sh

# Copy file from container
docker cp container_name:/path/to/file ./local/path

# Copy file to container
docker cp ./local/file container_name:/path/in/container

Multi-stage build:

# Dockerfile
FROM node:18 AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html

Useful Flags

docker run flags:

  • -d: Detached mode (background)
  • -it: Interactive terminal
  • -p: Port mapping (host:container)
  • -v: Volume mount
  • -e: Environment variable
  • --name: Container name
  • --rm: Auto-remove on exit
  • --network: Connect to network

docker exec flags:

  • -it: Interactive terminal
  • -u: User
  • -w: Working directory

Tips

  • Use .dockerignore to exclude files from build context
  • Combine RUN commands in Dockerfile to reduce layers
  • Use multi-stage builds to reduce image size
  • Always tag your images with versions
  • Use --rm for one-off containers
  • Use docker-compose for multi-container apps
  • Clean up regularly with docker system prune

Documentation

Official docs: https://docs.docker.com/ Dockerfile reference: https://docs.docker.com/engine/reference/builder/ Compose file reference: https://docs.docker.com/compose/compose-file/