我們的server設備為
到官網選擇適合的系統版本
[ref] Install Docker Engine
先選擇 "RHEL"看看
[ref] Install Docker Engine on RHEL
發現版本為x86_64
, 不符合s390x
條件
Q:Unable to install docker on rhel 8 linux
下載 RPM package 並手動安裝
https://download.docker.com/linux/centos/
選擇對應版本中的 x86_64/stable/Packages/
安裝檔案 .rpm
https://download.docker.com/linux/centos/8/x86_64/stable/Packages/docker-ce-24.0.4-1.el8.x86_64.rpm
此命令下載測試映像並在容器中運行它。當容器運行時,它會打印一條確認消息並退出。
[ref] Linux post-installation steps for Docker Engine
Continue to Linux postinstall to allow non-privileged users to run Docker commands and for other optional configuration steps.
To create the docker
group and add your user:
docker
group.You can also run the following command to activate the changes to groups:
驗證是否可在沒有 sudo 下運行 docker
此指令下載測試映像並在容器中運行它。當容器運行時,它會打印一條確認消息並退出。
If you initially ran Docker CLI commands using sudo
before adding your user to the docker
group, you may see the following error:
This error indicates that the permission settings for the ~/.docker/
directory are incorrect, due to having used the sudo
command earlier.
To fix this problem, either remove the ~/.docker/
directory (it’s recreated automatically, but any custom settings are lost), or change its ownership and permissions using the following commands:
Configure Docker to start on boot with systemd
在 Debian 和 Ubuntu 上,Docker 服務默認在啟動時啟動。
要使用 systemd 在其他 Linux 發行版上自動啟動 Docker 和 Containerd,請運行以下指令:
若要改回停止此行為,請使用 disable 指令
讓 docker container 支援使用gpu運算
docker-ce 從19.03版之後,Docker 引擎已經原生支援 NVIDIA GPU 運算,不再需要額外安裝 NVIDIA Docker 支援(NVIDIA Docker runtime)。
先前版本可參考: [安裝紀錄] 安裝 Docker-CE 與使用 Nvidia GPU
所以我們可以免安裝直接確認是否支援 GPU
啟動一個 container 來測試是否可偵測到
若正常會會顯示GPU資訊
– END –