Dockerイメージとコンテナの管理
イメージやコンテナの一覧表示、調査、停止、削除、クリーンアップに使う日常的なDockerコマンドを学び、環境を整理された状態に保ちます。
「Dockerイメージとコンテナの管理」はCoddyKit上の無料Docker & Kubernetes for Developersレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはDocker & Kubernetes for Developers学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Docker & Kubernetes for Developersコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
Images vs Containers
Two core concepts: an image is a read-only template (like a class), and a container is a running instance of it (like an object). One image, many containers.
Listing Images
List the images on your machine with docker images. Each row shows the repository, tag, id, and size.
docker imagesListing Containers
docker ps shows running containers; add -a to include stopped ones too.
docker ps -aInspecting a Container
docker inspect prints detailed JSON about a container or image — its config, network, mounts, and more.
docker inspect my_containerViewing Logs
Read a container's output with docker logs. Add the -f flag to follow the stream live, like tail -f.
docker logs -f my_containerStopping and Starting
docker stop halts a container gracefully (SIGTERM, then SIGKILL after a grace period) and docker start brings it back.
docker stop my_container
docker start my_containerRemoving a Container
Delete a stopped container with docker rm. You can't remove a running one unless you force it with -f.
docker rm my_containerRemoving an Image
Remove an image with docker rmi. It fails if any container still references it, so clear those dependent containers first.
docker rmi nginx:latestRunning a Command Inside
docker exec runs a command inside a running container. With -it you get an interactive shell to poke around.
docker exec -it my_container shCleaning Up with prune
Stopped containers and dangling images pile up over time. docker system prune reclaims all that space in one command.
docker system pruneNaming Containers
Give a container a friendly handle with --name at run time, so you reference it by name instead of a random id.
docker run --name web -d nginxQuick Check
Test your Docker management knowledge.
Recap
Recap: list with docker images and ps -a, dig in with inspect and logs, control lifecycle via stop/start/rm/rmi, and clean up with system prune.
AI チューターと学ぶ Docker & Kubernetes for Developers — 無料
ブラウザでリアルコードを書いて実行し、24/7 の AI チューターから瞬時にサポートを受け、ウェブまたはアプリで続きから学習できます。
- コース
- 12
- レッスン
- 48
よくある質問
「Dockerイメージとコンテナの管理」レッスンは無料ですか?
はい。「Dockerイメージとコンテナの管理」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Docker & Kubernetes for Developersコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Docker & Kubernetes for Developersコースには全4レッスンが含まれています。
「Dockerイメージとコンテナの管理」で何を学びますか?
イメージやコンテナの一覧表示、調査、停止、削除、クリーンアップに使う日常的なDockerコマンドを学び、環境を整理された状態に保ちます。 ブラウザで直接実行するハンズオンコードでDocker & Kubernetes for Developersを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Docker & Kubernetes for Developersを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのDocker & Kubernetes for Developersは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。
「Dockerイメージとコンテナの管理」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このDocker & Kubernetes for Developersレッスンでコードを書いて実行できますか?
はい。すべてのDocker & Kubernetes for Developersレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- コンテナ化入門
- Dockerのインストールと基本コマンド
- 初めてのコンテナを実行する
- Dockerイメージとコンテナの管理