進行IP連線
ping
ssh -l root
創建docker存放資料夾
mkdir /docker
安裝docker
dnf config-manager –add-repo=https://download.docker.com/linux/centos/docker-ce.repo
dnf update -y
dnf install -y docker-ce docker-ce-cli containerd.io
docker –version
修改路徑參數
構思docker檔案要放在哪個路徑, 以後方面維護, 假設放在 /docker ,請修改啟用參數
vi /lib/systemd/system/docker.service
###
(O) ExecStart=/usr/bin/dockerd -H fd:// –containerd=/run/containerd/containerd.sock
(E) ExecStart=/usr/bin/dockerd –data-root /docker -H fd:// –containerd=/run/containerd/containerd.sock
###
啟用docker
systemctl daemon-reload
systemctl enable docker
systemctl start docker
docker ps
ls -alt
df
進入docker
cd /docker
Reference : https://kafeiou.pw/2022/02/26/3740/rockylinux-%E5%AE%89%E8%A3%9D-docker/