vi getDocker.sh
//copy到getDocker.sh 保存退出
curl -sSL https://get.daocloud.io/docker | sh
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.4/docker-compose-uname -s-uname -m > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io
systemctl restart docker
service docker start
//安装portainerDocker Gui页面 可以不装
docker volume create portainer_data
systemctl restart docker
service docker start
docker run --restart=always -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
//安装成功后 ip:9000 到管理页面
//到Docker Hub找自己需要的版本
docker pull python:3.6.10-alpine
//查看本地python镜像
docker images python
mkdir myapp
cd myapp
vi main.py
#!/usr/bin/python
print(“Hello, World!”);
//保存退出
cd …/
docker run -v $PWD/myapp:/usr/src/myapp -w /usr/src/myapp python:3.6.10-alpine python main.py
//这样就可以看到Hello, World!打印出来了