docker run
docker run -d --name container1 ubuntu:latest /bin/sh -c "while true; do echo hello world; sleep 1; done"
dockerrun并查看container状态
挂载
docker run -d --name container_mount_demo --mount type=bind,source=/home/tml/boo/data,target=/opt ubuntu:latest /bin/sh -c "while true; do echo hello world; sleep 1; done"
验证挂载
进入容器
docker exec -it container_mount_demo bash
dockerfile安装net-tools
FROM ubuntu:latest
RUN apt-get update \
&& apt-get install -y net-tools
docker build -t ubuntu:net_tools .