Public | Automated Build

Last pushed: 2 years ago
Short Description
docker-run
Full Description

docker-run

build

docker build -t zouchao2010/docker-run .

run(创建并运行一个容器,退出时删除容器)

docker run  --name docker-run \
            -h docker-run \
            -v /data/docker-run_data:/var/lib/docker-run \
            -it --rm zouchao2010/docker-run

run(创建并运行一个容器,以守护进程方式)

docker run  --name docker-run \
            -h docker-run \
            -v /data/docker-run_data:/var/lib/docker-run \
            -dt zouchao2010/docker-run

start|stop|restart(已存在的容器)

docker start|stop|restart docker-run

exec(使用已运行的容器执行命令)

docker exec -it docker-run /bin/bash

结果

docker stop|restart 发送的信号都是15

[I 150805 01:58:52 service:25] Service Exit! signal:15

Ctrl+C 发送的信号是2

[I 150805 02:04:52 service:25] Service Exit! signal:2
Docker Pull Command
Owner
zouchao2010
Source Repository

Comments (0)