服务器上部署docker
1 2 3 4 5 6 7 8 9 10 11 12 13
| sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
sudo yum makecache fast sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo service docker start
sudo systemctl enable docker
|
docker镜像
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| { "registry-mirrors": [ "https://docker.hpcloud.cloud", "https://docker.m.daocloud.io", "https://docker.unsee.tech", "https://docker.1panel.live", "http://mirrors.ustc.edu.cn", "https://docker.chenby.cn", "http://mirror.azure.cn", "https://dockerpull.org", "https://dockerhub.icu", "https://hub.rat.dev" ] }
|
开启Docker的远程连接
- 先status看docker在哪

- 把该文件里面的参数修改
1
| ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
|
1 2
| systemctl daemon-reload systemctl restart docker.service
|
IDEA下载docker插件,配置docker服务器

根据dockerfile文件能直接部署到容器中了
如果build出现<font style="color:#DF2A3F;">Failed to deploy 'exam Dockerfile: Dockerfile': Not connected to docker</font>
则需要用管理员打开IDEA