docker以及docker-compose安装

centos7下docker安装

官方安装文档:
https://docs.docker.com/engine/installation/linux/docker- ce/centos/#docker-ee-customers

安装依赖包

yum install -y yum-utils device-mapper-persistent-data lvm2

添加Docker软件包源

yum-config-manager --add-repo
https://download.docker.com/linux/centos/docker-ce.repo

更新yum包索引

yum makecache fast

安装Docker CE

yum -y install docker-ce

启动

systemctl start docker

默认是国外的源,下载会慢,建议配置国内镜像仓库,并重启docker:

cat >> /etc/docker/daemon.json 

centos7下docker-compose安装

官方安装文档 https://docs.docker.com/compose/install/#upgrading

下载二进制文件【此处需访问上述链接,取得最新版本】

curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

添加执行权限

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

查看版本

docker-compose --version

你可能感兴趣的:(docker,&,k8s,docker,dcoker-compose)