Loading... ### Docker 导出容器导入后无法运行报错:Error response from daemon: No command specified. 根据报错信息是没有指定 command 加上 command即可运行 ```bash [root@wanghaoyu ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/ubuntu latest fb52e22af1b0 3 weeks ago 72.8 MB [root@wanghaoyu ~]# docker run -itd docker.io/ubuntu:latest 7ce403eba8d89127395e057eb4d6cf7eb2374e40214ce6575a29e755b707ca23 [root@wanghaoyu ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7ce403eba8d8 docker.io/ubuntu:latest "bash" 4 seconds ago Up 3 seconds hungry_babbage [root@wanghaoyu ~]# docker export -o test.tar 7ce403eba8d8 [root@wanghaoyu ~]# ls anaconda-ks.cfg test.tar [root@wanghaoyu ~]# docker import test.tar test/ubuntu:v0.1 sha256:c3d604273769f7a74126b27f29c8cecd055fc18b10c943da0c0528dc28520a60 [root@wanghaoyu ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE test/ubuntu v0.1 c3d604273769 4 seconds ago 72.8 MB docker.io/ubuntu latest fb52e22af1b0 3 weeks ago 72.8 MB [root@wanghaoyu ~]# docker run -itd test/ubuntu:v0.1 /usr/bin/docker-current: Error response from daemon: No command specified. See '/usr/bin/docker-current run --help'. # 加上 /bin/bash [root@wanghaoyu ~]# docker run -itd test/ubuntu:v0.1 /bin/bash 5b7dca448a1400716fa931463c2c314e0e59c7888fa77d5b182e72d911122966 [root@wanghaoyu ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5b7dca448a14 test/ubuntu:v0.1 "/bin/bash" 3 seconds ago Up 2 seconds ``` Last modification:April 25, 2025 © Allow specification reprint Support Appreciate the author Like 如果觉得我的文章对你有用,请随意赞赏