0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VPSにDockerEngineを導入する

Posted at

はじめに

VPSの基本運用はdocker fileでデプロイするだけにして楽にしたい!!
将来的にjenkinsも入れてCI/CDをやれるとうれしい。

DockerにはDockerEngineとDockerDesktopの2種類存在するが、VPSのメモリがあまり大きくない場合などはCLIベースのDockerEngineを導入します

環境

Ubuntu24.04
Docker27.3.1

古いDockerを削除する

$ sudo apt-get remove docker docker-engine docker.io containerd runc

Dockerリポジトリの設定

依存パッケージのインストール

$ sudo apt-get update
$ sudo apt-get install ca-certificates curl gnupg lsb-release

GPG鍵の取得

# GPG鍵の保管場所を作成
$ sudo mkdir -p /etc/apt/keyrings

# GPG鍵をバイナリ形式で保存
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

リポジトリのダウンロード

$ 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

# apt-getキャッシュクリア
$ sudo apt-get update

Dockerインストール

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

Dockerバージョン確認

$ docker --version
Docker version 27.3.1, build ce12230

参考文献

参考:Ubuntu 22.04にdockerをインストールする
参考:Ubuntu _ Docker ドキュメント

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?