Docker运行需要依赖jdk,所以需要先安装一下jdk
yum install -y java-1.8.0-openjdk.x86_64
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce
systemctl start docker
docker version
docker info
docker ps -a
curl -L https://github.com/docker/compose/releases/download/v2.21.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
docker-compose -f 自定义的.yml up -d
常见的zookeeper的yml配置如下
version: '3.1'
services:
dev_zoo:
image: zookeeper:latest
container_name: dev_zoo
ports:
- 2181:2181
启动完之后,也可以用docker ps -a 来查看启动的docker实例
码字不易,记得点赞关注哟!