1.查找主机上关于Docker的软件包
rpm -qa | grep docker – – 列出包含docker字段的软件的信息
2.使用yum remove卸载软件
yum remove docker-client-1.13.1-161.git64e9980.el7_8.x86_64
yum remove python36-docker-pycreds-0.2.1-2.el7.noarch
yum remove docker-common-1.13.1-161.git64e9980.el7_8.x86_64
yum remove docker-1.13.1-161.git64e9980.el7_8.x86_64
yum remove python36-dockerpty-0.4.1-18.el7.noarch
yum remove python36-docker-2.6.1-3.el7.noarch
3.使用curl升级到最新版
curl -fsSL https://get.docker.com/ | sh
4.重启Docker
systemctl restart docker
5.设置Docker开机自启
systemctl enable docker
6.查看Docker版本信息
docker version
7.查看Docker系统信息,包括镜像和容器数…
docker info
8.docker-compose
# 后台启动容器
docker-compose up -d
docker-compose ps
# 停止容器
#查看docker-compose版本
docker-compose -v
注意:这个一定要设置目录
否则后面会踩坑(导致如下问题,也面登陆502)
./prepare
./install.sh
[root@VM_83_147_centos docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
jenkins latest f1227eda1de6 6 days ago 517MB
mytomcat v1 516a4a228236 2 months ago 533MB
[root@VM_83_147_centos harbor]# docker tag mytomcat:v1 harbor.lixiuyang.com/eshop/tomcat
[root@VM_83_147_centos harbor]# docker push harbor.lixiuyang.com/eshop/tomcat
The push refers to repository [harbor.lixiuyang.com/eshop/tomcat]
de1ea97140a5: Pushed
690fbbe97481: Pushed
d27e164cc159: Pushed
3c1fd77de487: Pushed
ac3e2c206c49: Pushed
3663b7fed4c9: Pushed
832f129ebea4: Pushed
6670e930ed33: Pushed
c7f27a4eb870: Pushed
e70dfb4c3a48: Pushed
1c76bd0dc325: Pushed
latest: digest: sha256:b429701f5d816ae3321d82e8e886a1ba3774d3533f5cf3b552cf958e33111dd2 size: 2632
✖ Need to install docker-compose(1.18.0+) by yourself first and run this script again.
Compose 安装
Linux
Linux 上我们可以从 Github 上下载它的二进制包来使用,最新发行的版本地址:https://github.com/docker/compose/releases。
运行以下命令以下载 Docker Compose 的当前稳定版本:
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
要安装其他版本的 Compose,请替换 1.24.1。
将可执行权限应用于二进制文件:
$ sudo chmod +x /usr/local/bin/docker-compose
创建软链:
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
测试是否安装成功:
$ docker-compose --version
cker-compose version 1.24.1, build 4667896b
注意: 对于 alpine,需要以下依赖包: py-pip,python-dev,libffi-dev,openssl-dev,gcc,libc-dev,和 make。
74f87f42bb4aa84cac2968". You have to remove (or rename) that container to be able to reuse that name.
ERROR: for registry Cannot create container for service registry: Conflict. The container name "/registry" is already in use by container "53dfbecb65b8a10b42bbb8a8f3f9913af59f06cf8e74f87f42bb4aa84cac2968". You have to remove (or rename) that container to be able to reuse that name.
ERROR: Encountered errors while bringing up the project.
解决方法:
docker rm 53dfbecb65b8a10b42bbb8a8f3f9913af59f06cf8e74f87f42bb4aa84cac2968
/var/log/harbor
问题:Error response from daemon: Get https://140.143.249.40:80/v2/: dial tcp 140.143.249.40:80: connect: connection refused
vi /etc/docker/daemon.json
systemctl daemon-reload
systemctl restart docker
参考博文:https://blog.csdn.net/xoofly/article/details/106213499