首页 > 代码库 > docker note

docker note

环境: docker1.10.3

#hello docker
 docker run --name myhello docker.io/centos:67591570dd29 /bin/echo ‘hello docker‘

#基于镜像启动容器
   docker run -t -i docker.io/centos:67591570dd29 /bin/bash

   docker run --name artifactory -t -i -p 8000:80 docker.io/mattgruter/artifactory /bin/bash


   docker run --name zk -t -i -p 8000:80 -v /software/package:/software/package fanll/zk /bin/bash

#启动容器
 docker start zk
 docker stop zk

#进入容器,exit命令,容器不停止
 docker exec -t -i zk /bin/bash

#挂载本地目录(临时关闭selinux)
 su -c "setenforce 0"
 docker run --name zk -t -i -v /software/package:/software/package docker.io/centos:67591570dd29 /bin/bash
 
#删除所有容器
 docker rm `docker ps -a |awk ‘{print $1}‘ | grep [0-9a-z]`

docker note