自学内容网 自学内容网

Ubuntu24.04部署docker

1、更新软件

apt  update

2、安装curl

apt install apt-transport-https curl

3、导入阿里云GPG秘钥

curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

4、添加Docker阿里云仓库到Ubuntu 24.04的软件源列表
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu/ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

更新

apt update

5、安装Docker

apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin

确定安装成功

docker version

如果运行出现提示:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

重启service服务

systemctl restart docker.service 

6、安装Docker Compose

直接官方拉去:

curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-Linux-x86_64 > /usr/local/bin/docker-compose


chmod +x /usr/local/bin/docker-compose

查看版本

docker-compose version


原文地址:https://blog.csdn.net/SU19920923/article/details/142299900

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!