3
3

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.

WSLにdockerをインストール

Posted at

はじめに

はじめに、wslでdockerを扱いたかったので、導入手順を備忘録として残す。

Dockerインストール

参考サイトをもとにインストールを行なった。

はじめにWSL内のパッケージを最新の状態にする。

sudo apt-get update
sudo apt-get upgrade -y

次にdockerリポジトリを設定する。

# Add Docker's official GPG key:

#ca-certificateパッケージのインストール
sudo apt-get install ca-certificates curl

#指定したディレクトリにファイルをコピー
sudo install -m 0755 -d /etc/apt/keyrings

#複合化のためのキーをダウンロード
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc

#全ての変更対象に読み取りのみの権限を付与
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

実際のインストールコマンドは以下

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

以下コマンドでインストールされたdockerのバージョンを確認し、出力されればインストール完了

docker -v

参考サイト

Docker公式
Zenn:WSL(Ubuntu)にDocker環境を構築する

3
3
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
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?