ERROR: for xxx Cannot create container for service xxx: No command specified

问题:

ERROR: for high_mysql  Cannot create container for service high_mysql: No command specified
ERROR: Encountered errors while bringing up the project.


问题描述:

  • 利用docker的export和save分别对容器和镜像进行打包

root@miguan1:/opt/tpot/etc# docker export 512c649c07ba > a.tar
root@miguan1:/opt/tpot/etc# docker save new_1:v1 > b.tar
root@miguan1:/opt/tpot/etc# ls
a.tar  b.tar  compose  curator  logrotate  objects  tpot.yml
root@miguan1:/opt/tpot/etc# scp -r ./a.tar zeek@192.168.1.43:/home/zeek
zeek@192.168.1.43's password:
a.tar                                                                                       100%  567MB  90.6MB/s   00:06
root@miguan1:/opt/tpot/etc# scp -r ./b.tar zeek@192.168.1.43:/home/zeek
zeek@192.168.1.43's password:
b.tar  
                                                                                     100%  574MB  92.1MB/s   00:06

  •  分别生成新的镜像文件

root@miguan12:/opt# cat a.tar |docker import - new1:v1
sha256:55bd7ba312f7b73fa56f3dd81d408f5122efa1d828eb116b3f889e28282198d4
root@miguan12:/opt# docker load -i b.tar
d0f104dc0a1f: Loading layer [==================================================>]  72.49MB/72.49MB
316393412e04: Loading layer [==================================================>]  338.4kB/338.4kB
e9affce9cbe8: Loading layer [==================================================>]  9.539MB/9.539MB
e8fd11b2289c: Loading layer [==================================================>]    4.2MB/4.2MB
b55e8d7c5659: Loading layer [==================================================>]  1.536kB/1.536kB
ae39983d39c4: Loading layer [==================================================>]  53.76MB/53.76MB
f358b00d8ce7: Loading layer [==================================================>]  6.656kB/6.656kB
51b229f856aa: Loading layer [==================================================>]  3.584kB/3.584kB
7bab08caa6f2: Loading layer [==================================================>]  409.1MB/409.1MB
5395b9570fad: Loading layer [==================================================>]  5.632kB/5.632kB
3f1e7f3d4754: Loading layer [==================================================>]  16.38kB/16.38kB
6aba858f7ab9: Loading layer [==================================================>]  1.536kB/1.536kB
3baf2250f2e3: Loading layer [==================================================>]  52.34MB/52.34MB
e6d2bba89887: Loading layer [==================================================>]  28.67kB/28.67kB
d85e245a3df1: Loading layer [==================================================>]  9.728kB/9.728kB
Loaded image: new_1:v1
root@miguan12:/opt# docker images
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
new1                       v1                  55bd7ba312f7        6 minutes ago       588MB
new_1                      v1                  82985bcdcd96        22 hours ago        595MB


  • 镜像比较

红框以Cmd语令差异做出对比,可以利用docker inspect  镜像。可以看出,export的导出的镜像不带有容器运行时的第一条语令,save保存的镜像较为完整。原因:export导出的tar文件只是当前正在运行的容器,而包括docker run创建容器后/bin/sh -c后面的语令。

  • 分别测试镜像生成容器的情况

自定义tpot.yml文件:
high_mysql:
    container_name: high_mysql
    image: new1:v1   # --> 根据测试镜像不同进行更换 
    tty: true
    networks:
    - cowrie_local
    environment:
    - MYSQL_ROOT_PASSWORD=123456
    ports:
    - '3306:3306'
    read_only: true
    restart: 'no'
    tty: true
    volumes:
    - /data/mysql:/opt

(*)使用new1:v1镜像
root@miguan12:/opt/tpot/etc# docker-compose -f /opt/tpot/etc/tpot.yml up -d high_mysql
WARNING: Some networks were defined but are not used by any service: heralding_local, spiderfoot_local
Creating high_mysql ...
Creating high_mysql ... error

ERROR: for high_mysql  Cannot create container for service high_mysql: No command specified

ERROR: for high_mysql  Cannot create container for service high_mysql: No command specified
ERROR: Encountered errors while bringing up the project.

(*)验证
root@miguan12:/opt/tpot/etc# docker ps -a
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS                 PORTS

(*)使用new_1:v1镜像
root@miguan12:/opt/tpot/etc# docker-compose -f /opt/tpot/etc/tpot.yml up -d high_mysql
WARNING: Some networks were defined but are not used by any service: heralding_local, spiderfoot_local
Creating high_mysql ...
Creating high_mysql ... done

(*)验证
root@miguan12:/opt/tpot/etc# docker ps -a
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS                 PORTS                               NAMES
f967b9dfc2b3        new_1:v1                        "docker-entrypoint.s…"   38 seconds ago      Up 32 seconds          0.0.0.0:3306->3306/tcp, 33060/tcp   high_mysql

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当你遇到错误信息"The system cannot find the file specified"时,这通常是由于文件路径或命名空间引起的问题。根据引用和引用的内容,这个错误可能是由于权限问题或命名空间导致的。 在某些情况下,这个错误可能是由于权限问题引起的,这意味着你没有足够的权限来访问或找到指定的文件。你可以尝试以管理员身份运行程序或检查文件的访问权限以解决此问题。 另一种可能性是命名空间的冲突。根据引用的内容,当使用脚本语言调用进程时,子进程可能会继承父进程的命名空间,导致通过名称查找内核对象失败。这可能会导致无法找到指定的文件。为了解决这个问题,你可以尝试在不同的应用环境中分别启动进程,以避免命名空间的冲突。 关于你提到的错误信息中的具体路径问题,我无法确定这些路径是什么具体文件或目录的路径。根据引用的内容,它提到了两个路径,一个是root路径为"D:\ApplicationSoft\nvm119",另一个是path路径为"D:\Program Files\nodejs14\node-v14.17.1-win-x64"。根据这些路径,可能是你在使用某个应用程序或脚本时出现了路径配置错误,导致无法找到指定的文件。 为了更好地解决你的问题,我建议你仔细检查你的应用程序或脚本中的路径配置,并确保路径是正确的。如果问题仍然存在,你可能需要提供更多的详细信息或咨询相关的技术支持来解决该问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [ASP.NET The system cannot find the file specified解决办法](https://download.csdn.net/download/weixin_38571878/14011940)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Error code 2: The system cannot find the file specified.](https://blog.csdn.net/vcPlayer/article/details/7612795)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [nvm报错: ERROR open \settings.txt: The system cannot find the file specified](https://blog.csdn.net/weixin_45719444/article/details/126432836)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值