解決dockerfile 創建鏡像報 exec format error問題 及容器退出問題

[root@localhost etc]# docker run -it --name my_centos7_cklpost8.1  --net=host    centos7_cklpost6.0 /bin/bash 
standard_init_linux.go:211: exec user process caused "exec format error"
[root@localhost etc]# 
[root@localhost etc]# 
[root@localhost etc]# docker run -it --name my_centos7_cklpost8.2  --net=host    centos7_cklpost6.0
standard_init_linux.go:211: exec user process caused "exec format error"
failed to resize tty, using default size
 

1.調試方法, 不加d, 讓前臺運行.  docker run -itd --name my_centos7_cklpost8.2  --net=host    centos7_cklpost6.0

2. "exec format error" 是因爲.sh裏沒添加 #!/bin/bash

3. 直接退出是因爲 docker必須有一個前臺進程在最後運行, 不然會誤認爲沒事可做.  就類型c++程序裏主進程裏添加多個線程啓動後要加 一個鎖, 或是sleep(1000000000...). 這裏取巧用個 touch tt.log  tail -f ./tt.log 作爲前臺

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章