최신 이미지 다운로드 - 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

관련 정보