docker run -p 10001:80 -d nginx:latest
docker ps -a | awk '{if(NR>=2){print $1}}' | xargs docker stop
docker ps -a | awk '{if(NR>=2){print $1}}' | xargs docker rm
docker images -a | awk '{if(NR>=2){print $1}}' | xargs docker rmi
docker build -t centos7-nginx:v1 .
根据当前目录下的Dockerfile文件生成镜像,repository为 centos7-nginx,tag为v1
容器名为nginx-server
echo "nginx is working" > /opt/nginx-server/index.html