最新のイメージをダウンロードする - docker: デーモンのエラー応答: OCI ランタイム生成に失敗しました: コンテナ_linux.go:348:

最新のイメージをダウンロードする - docker: デーモンのエラー応答: OCI ランタイム生成に失敗しました: コンテナ_linux.go:348:

ビジボックス画像をダウンロードしてインポートしたいのですが、それでも次のエラーが発生します。

λ bgarcial [~] → sudo docker run busybox:1.29 "hello world"
Unable to find image 'busybox:1.29' locally
1.29: Pulling from library/busybox
90e01955edcd: Already exists 
Digest: sha256:2a03a6059f21e150ae84b0973863609494aad70f0a80eaeb64bddd8d92465812
Status: Downloaded newer image for busybox:1.29
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"hello world\": executable file not found in $PATH": unknown.
ERRO[0004] error waiting for container: context canceled 

λ bgarcial [~] → sudo docker images                        
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
busybox             1.29                59788edf1f3e        2 months ago        1.15MB
hello-world         latest              4ab4c602aa5e        3 months ago        1.84kB

λ bgarcial [~] →

コマンドなどの他のイメージを使用すると、同じエラーは発生しませんsudo docker run mongo:4-xenial...

私の質問は、実行中の私のコンテナに「hello world」をパラメータとして渡すときに発生する可能性がありますか?

ベストアンサー1

Dockerコンテナにコマンドを渡すときは、Dockerコンテナ内のシェルで実行できる必要があります。この場合、「Hello World」は実行したい実行可能ファイルの名前とみなされます。有効な実行ファイル名ではないため、Dockerは次のエラーを返します。

[root@testvm1 test]# docker run busybox "Hello World"
container_linux.go:247: starting container process caused "exec: \"Hello World\": executable file not found in $PATH"
/usr/bin/docker-current: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"Hello World\": executable file not found in $PATH".

次の行に注意してください"exec: \"Hello World\": executable file not found in $PATH"

たとえば、コンテナ内で有効なコマンドを使用してecho機能させます。

[root@testvm1 test]# docker run busybox echo "Hello World"
Hello World

シェルを使用してコンテナをインタラクティブに実行しても、同じ動作が表示されます。

[root@testvm1 test]# docker run -it busybox /bin/sh
/ # "Hello World"
/bin/sh: Hello World: not found
/ # echo "Hello World"
Hello World

おすすめ記事