docker常用命令

1、基于镜像48dd385504b1新建一个 Tomcat 容器并启动,并挂载webapps,logs,conf文件夹

docker run -v /etc/localtime:/etc/localtime:ro -id --name=test_tomcat -e JAVA_OPTS='-Xmx128m' -p 8888:8082 -v /usr/local/tuling-project/tomcat-test/webapps:/usr/local/tomcat/webapps -v /usr/local/tuling-project/tomcat-test/logs:/usr/local/tomcat/logs -v /usr/local/tuling-project/tomcat-test/conf:/usr/local/tomcat/conf --privileged=true 48dd385504b1

2、进入容器ID为565a411dbcd7的容器

docker exec -it 565a411dbcd7 /bin/bash

3、启动容器ID为76df5b964b1e的容器

docker start  76df5b964b1e

4、停止容器ID为76df5b964b1e的容器

docker stop 76df5b964b1e

5、重启Docker

systemctl restart docker

你可能感兴趣的:(docker常用命令)