0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Docker 設定 (for Winodws10)

Posted at

Windows 設定

[Windowsの機能の有効化または無効化]の設定で以下をチェック

  • Linux 用 Windows サブシステム
  • 仮想マシンプラットフォーム
    変更を適用してPCを再起動

x64マシン用WSL2 Linuxカーネル更新用プログラムパッケージをインストール
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

Docker Desktopココからダウンロード
Use WSL2 instead of Hyper-V(recommended)にチェックを入れたままOKでインストール

サンプルプロジェクトを動かす

ココからサンプルを持ってくる

git clone https://github.com/docker/welcome-to-docker.git

DockerfileからDockerイメージを作成

cd welcome-to-docker
docker build -t welcome-to-docker .

コンテナを起動

docker run -d -p 8088:3000 --name welcome-to-docker welcome-to-docker

各種コマンドについて

docker build
DockerfileからDockerイメージを作成するために使用

-t welcome-to-docker
-t オプションは、作成されるイメージにタグ(名前)を付けるために使用
この場合、「welcome-to-docker」という名前が新しく作成されるイメージに付けられる

.
最後の . はビルドコンテキストの場所を指定

ここでは、現在のディレクトリ(.)がビルドコンテキストとして指定される。
ビルドコンテキストとは、DockerfileとともにDockerデーモンに送られるファイルやディレクトリのこと

Reference

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?