Overview of the Docker workshopDockerワークショップの概要

This 45-minute workshop contains step-by-step instructions on how to get started with Docker. This workshop shows you how to:この45分間のワークショップでは、Dockerの使い始め方についてのステップバイステップの指示が含まれています。このワークショップでは、次のことを示します:

  • Build and run an image as a container.イメージをコンテナとしてビルドして実行する。
  • Share images using Docker Hub.Docker Hubを使用してイメージを共有する。
  • Deploy Docker applications using multiple containers with a database.データベースを使用して複数のコンテナでDockerアプリケーションをデプロイする。
  • Run applications using Docker Compose.Docker Composeを使用してアプリケーションを実行する。
Note

For a quick introduction to Docker and the benefits of containerizing your applications, see Getting started.Dockerとアプリケーションをコンテナ化することの利点についての簡単な紹介については、 はじめにを参照してください。

What is a container?コンテナとは何ですか?

A container is a sandboxed process running on a host machine that is isolated from all other processes running on that host machine. That isolation leverages kernel namespaces and cgroups, features that have been in Linux for a long time. Docker makes these capabilities approachable and easy to use. To summarize, a container:コンテナは、ホストマシン上で実行されているサンドボックス化されたプロセスであり、そのホストマシン上で実行されている他のすべてのプロセスから隔離されています。その隔離は、カーネルネームスペースとcgroupsを活用しており、これらの機能はLinuxに長い間存在しています。Dockerはこれらの機能を身近で使いやすくしています。要約すると、コンテナは:

  • Is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API or CLI.イメージの実行可能なインスタンスです。Docker APIまたはCLIを使用して、コンテナを作成、開始、停止、移動、または削除できます。
  • Can be run on local machines, virtual machines, or deployed to the cloud.ローカルマシン、仮想マシンで実行することも、クラウドにデプロイすることもできます。
  • Is portable (and can be run on any OS).ポータブルであり、任意のOS上で実行できます。
  • Is isolated from other containers and runs its own software, binaries, configurations, etc.他のコンテナから隔離されており、自身のソフトウェア、バイナリ、設定などを実行します。

If you're familiar with chroot, then think of a container as an extended version of chroot. The filesystem comes from the image. However, a container adds additional isolation not available when using chroot.もしchrootに慣れているなら、コンテナをchrootの拡張版と考えてください。ファイルシステムはイメージから来ます。しかし、コンテナはchrootを使用する際には得られない追加の隔離を提供します。

What is an image?イメージとは何ですか?

A running container uses an isolated filesystem. This isolated filesystem is provided by an image, and the image must contain everything needed to run an application - all dependencies, configurations, scripts, binaries, etc. The image also contains other configurations for the container, such as environment variables, a default command to run, and other metadata.実行中のコンテナは隔離されたファイルシステムを使用します。この隔離されたファイルシステムはイメージによって提供され、イメージにはアプリケーションを実行するために必要なすべてのもの - すべての依存関係、設定、スクリプト、バイナリなど - が含まれていなければなりません。また、イメージにはコンテナのための他の設定、例えば環境変数、実行するためのデフォルトコマンド、その他のメタデータも含まれています。

Next steps次のステップ

In this section, you learned about containers and images.このセクションでは、コンテナとイメージについて学びました。

Next, you'll containerize a simple application and get hands-on with the concepts.次に、シンプルなアプリケーションをコンテナ化し、概念を実践します。

Containerize an application