1
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?

dockerをLinux運用する方法

1
Posted at

大企業案件ほどdockerのデスクトップ版がライセンスの関係で承認がとりづらいという
観点でlinuix版だとそのデメリットを回避できるというのを知ったので
構築する方法をまとめます。

powershellでwslの確認

- wsl --status

- なければインストール
wsl --install -d ubuntu-22.04

ubuntuでdockerインストール

# 古いDockerを完全削除
sudo apt remove -y docker docker-engine docker.io containerd runc

# パッケージ更新と必要ツールのインストール
sudo apt update
sudo apt install -y ca-certificates curl gnupg lsb-release

# Docker公式GPGキーの追加
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
  sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

# Dockerリポジトリの追加
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
  https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Docker Engineのインストール
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

動作確認

# バージョン確認
sudo docker --version
sudo docker compose version

# テスト実行
sudo docker run hello-world

# コンテナ一覧
sudo docker ps -a

ubuntuで使用を想定のためsudoをコマンドを使うが外して使う設定はまた次回!

1
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
1
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?