我有一个docker image dajobe / hbase,它是用Ubuntu构建的.我创建了一个这个图像的容器,并将其命名为hb.
$docker run -d --name hb dajobe/hbase
e1f68ff8b3b6c5e474426e2566f8c087d6a785fc5eeb58cd2aeb86176068651d
然后我在hb上启动了/ bin / bash,并检查了vi编辑器的可用性.
$docker exec -it hb /bin/bash
root@e1f68ff8b3b6:/# vi
bash: vi: command not found
然后我使用apt-get安装了vi编辑器
# apt-get install vim
Reading package lists...
DoneBuilding dependency tree
Reading state information... Done
.....
.....
我想提交更改,以便vi编辑器可以保留.
$docker commit hb dajobe/hbase
1be196188efc5a52562dc8ee1b63d0fd560ea163c49331c10dc435848d75ef64
然后,当我再次启动dajobe / hbase时,它会自动停止.
$docker run -d --name hb dajobe/hbase
c3e7b9f48077ef854efc6f9bab5e85986e265c98de5423bece0000c973206c38
$docker exec -it hb /bin/bash
FATA[0000] Error response from daemon: Container hb is not running
为什么容器没有运行?
$docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c3e7b9f48077 dajobe/hbase:latest "/opt/hbase-server" 11 secs ago Exited (0) 8 secs ago hb
为什么状态“已退出”?在提交之前,情况并非如此,状态为“Up”.