![VSCode-Docker가 "CMD"를 호출하지 않음](https://rvso.com/image/782623/VSCode-Docker%EA%B0%80%20%22CMD%22%EB%A5%BC%20%ED%98%B8%EC%B6%9C%ED%95%98%EC%A7%80%20%EC%95%8A%EC%9D%8C.png)
TL;DRVSCode로 빌드된 이미지는 Docker Desktop UI에서 실행 버튼을 누를 때만 CMD 명령을 실행합니다.
안녕하세요 여러분,
저는 Docker Desktop 및 VSCode와 함께 Drools 이미지를 가지고 놀고 있습니다.
내 devcontainer.json
파일은 다음과 같습니다.
{
"name": "Existing Dockerfile",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile"
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8001,8080]
}
My는 Dockerfile
미니멀리스트이며 다음과 같습니다.
FROM quay.io/kiegroup/business-central-workbench:latest
내 compose.yaml
파일은 다음과 같습니다.
services:
app:
entrypoint:
- sleep
- infinity
image: docker/dev-environments-default:stable-1
init: true
volumes:
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
문제는 VSCode가 Docker Desktop에 이미지를 보낼 때
CMD ["./start_business-central-wb.sh"]
상위 이미지에서 발견된 이미지가 로그에 표시된 대로 시작되지 않는 것 같다는 것입니다.
그러나 "실행"을 클릭하면 새 인스턴스를 생성한 후 명령이 시작됩니다.
VSCode가 Docker Desktop에 이미지를 보낼 때 Docker 이미지가 즉시 실행되지 않는 이유에 대해 제가 놓치고 있는 개념은 무엇입니까? 저는 두 가지 기술 모두에 대해 경험이 없습니다.
어떤 도움이라도 대단히 감사하겠습니다.
답변1
overrideCommand
문제는 내 devcontainer.json
파일 에서 사용하지 않았다는 것입니다 . 이 값을 false로 설정하면 컨테이너에 나열된 CMD가 실행될 수 있습니다.
다음 파일은 내가 생각하기에 해야 할 일을 하는 것 같습니다.
{
"name": "Debian",
"image": "quay.io/kiegroup/business-central-workbench:latest",
"overrideCommand": false
}