# docker imagesweb
# docker run -d --restart=always -p 8091:8091 --name xinyar_erp_web_test xinyar/erp-webdocker
参数说明:api
-d 开启Daemon模式bash
--restart=always在容器退出时老是重启容器(docker开机/重启)网络
-p 8091:8091 指定端口映射,eg:spa
-p hostPort:containerPortrest
-p ip:hostPort:containerPort日志
-p ip::containerPortip
-p hostPort:containerPort:udpit
--name xinyar_erp_web_test 容器识别
xinyar/erp-web 指定镜像名称
# docker logs containerName/containerId
eg、
docker logs -f xinyar_erp_web_test
docker logs -f 0f9b05aa74cf
# docker stop containerName/containerId
eg、
docker stop xinyar_erp_web_test
# docker start containerName/containerId
eg、
docker start xinyar_erp_web_test
# docker restart containerName/containerId
eg、
docker restart xinyar_erp_web_test
# docker rm –f containerName/containerId
eg、
docker rm -f xinyar_erp_web_test
# docker rmi -f IMAGE_ID/ REPOSITORY:TAG
eg、docker rmi -f f104cf54406b
docker rmi -f registry: latest
若TAG为latest,则可不用写,如: docker rmi -f registry
# docker search images_name
# docker pull images_name
# docker command --help
# docker port con_id
eg、docker port 51d58caec77d
# docker ps
# docker ps -a
# docker exec -it 容器ID /bin/bash
# docker attach containerId #不推荐使用(退出容器的时候,容器会中止)
# docker network ls
# docker top con_name
eg、docker top xinyar_erp_web_test
1八、强制删除镜像名称中包含“doss-api”的镜像
docker rmi --force $(docker images | grep doss-api | awk '{print $3}')