比如拉取silsuer/yapi
docker pull silsuer/yapi
mkdir -p /Users/xll/yapi/mongodata
mkdir -p /Users/xll/yapi/config
docker run --name yapi -dit -p 27017:27017 -p 9090:9090 -p 3000:3000 -v /Users/xll/yapi/mongodata/:/var/lib/mongodb/ -v /Users/xll/yapi/config/:/my-yapi/ silsuer/yapi bash
docker attach yapi
或者
docker exec -it yapi /bin/bash
service mongodb start
apt-get update
这是由于docker容器里面运行apt-get的该容器的镜像比较旧,所以导致签名过期,解决办法:
sudo apt-key list | grep -A 1 expired
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 91FA4AD5
apt-get install git
git --version
yapi server
原文:https://www.cnblogs.com/chocolatexll/p/13233577.html