- 安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- 在虚拟机上创建一个文件夹,然后进入该文件夹,我这里创建一个kafka的文件夹 mkdir kafka
- 创建一个docker-compose.yml文件,文件内容如下
version: '3'
services:
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2181:2181"
kafka