Score:0

VSCode-Docker Not Invoking "CMD"

cn flag

TL;DR Image built by VSCode only executes the CMD command when I press the Run button in the Docker Desktop UI.

Hello Folks,

I'm playing around with a Drools image along with Docker Desktop and VSCode.

My devcontainer.json file looks like the following:

{
    "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 is minimalist and looks like the following:

FROM quay.io/kiegroup/business-central-workbench:latest

And my compose.yaml file looks like so:

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

The issue is that when VSCode sends the image to Docker Desktop, the CMD ["./start_business-central-wb.sh"] found in the parent image does not seem to be getting set off as seen in the logs

Docker No Run Image.PNG

However, when I click "Run" the command gets kicked off after spawning a new instance enter image description here

enter image description here

What concept am I missing as to why the Docker image doesn't immediately begin running when VSCode sends it to Docker Desktop? I'm super inexperienced with both techs.

Any help is greatly appreciated.

Score:0
cn flag

The issue was that I was not using overrideCommand in my devcontainer.json file. This value when set to false allows the CMD listed in the container to run.

The following file seems to do what I believe it should be doing.

{
    "name": "Debian",
    "image": "quay.io/kiegroup/business-central-workbench:latest",
    "overrideCommand": false
}
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.