Docker安装
Windows安装
检查docker是否安装成功
docker version
Client: Docker Engine - Community
Version: 18.09.2
API version: 1.39
Go version: go1.10.8
Git commit: 6247962
Built: Sun Feb 10 04:12:31 2019
OS/Arch: windows/amd64
Experimental: false
拉取docker的测试镜像
docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:4df8ca8a7e309c256d60d7971ea14c27672fc0d10c5f303856d7bc48f8cc17ff
Status: Downloaded newer image for hello-world:latest
运行docker的测试镜像
docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
Linux安装
准备安装:
#关闭防火墙:
关闭: systemctl stop firewalld
开机禁用 : systemctl disable firewalld
#修改相关配置然后重启
vi /etc/selinux/config
SELINUX=disabled
reboot
安装
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
或添加阿里云的安装源
sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum -y install docker-ce
yum update xfsprogs
systemctl start docker
docker version
docker pull hello-world
docker run hello-world
问题
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
的解决方法:
在命令行输入:yum clean all