docker import导入容器镜像后执行docker run 提示 Error response from daemon: No command specified 问题处理
有网友说这是docker的一个bug 只要在run后增加 额外前台运行指令即可 如bash、top、ping等。
[root@lnmp cmmlnmp]# docker export 20cde728e74e > cmmlnmp-oracle-sqlsrv.tar
[root@lnmp cmmlnmp]# docker import cmmlnmp-oracle-sqlsrv.tar cmm_oracle_sqlsrv:v1
sha256:e0beaa1f14c8e9ceb06d914ab7b88d05b18486ac0da7907329b61582e337301e
[root@lnmp cmmlnmp]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
cmm_oracle_sqlsrv v1 e0beaa1f14c8 12 seconds ago 1.82GB
[root@lnmp cmmlnmp]# docker run -idt -p9992:80 --name cmm-sql cmm_oracle_sqlsrv:v1
docker: Error response from daemon: No command specified.
See 'docker run --help'.
[root@lnmp cmmlnmp]# docker run -idt -p9992:80 --name cmm-sql cmm_oracle_sqlsrv:v1 bash
5455049e02ecce86349a76d447d37a220d5c44ead9d530bdddb63d8519a3ea60
[root@lnmp cmmlnmp]# docker images ls
REPOSITORY TAG IMAGE ID CREATED SIZE
[root@lnmp cmmlnmp]# docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5455049e02ec cmm_oracle_sqlsrv:v1 "bash" 20 seconds ago Up 18 seconds 0.0.0.0:9992->80/tcp cmm-sql
20cde728e74e royeecai/cmmlnmp "/usr/sbin/init" 37 minutes ago Up 37 minutes 0.0.0.0:9999->80/tcp, 0.0.0.0:9998->443/tcp, 0.0.0.0:9997->3306/tcp, 0.0.0.0:9996->9000/tcp cmmlnmp
[root@lnmp cmmlnmp]# docker exec -it cmm-sql bash
[root@5455049e02ec /]#