Can you change the CMD of the node layer – Docker

I’m new to docker so i’m not sure if theres a much simpler way to go about it but. I want to use the node docker layer as my base layer, only the CMD in the dockerfile is set to CMD ["npm", "start] by default. Is there anyway to change this initial CMD?

Reason for change:
I have a specific start script to enable production mode and i would prfer to keep my setup the same.

  • Docker Toolbox SSH Login
  • Can't expose a fuse based volume to a Docker container
  • Following the Get Started: Stack server stuck loading page endlessly
  • Save a file generated by app running on docker to a given path in the host machine
  • Is there any way to “apply a patch” to a docker image?
  • Mounting a gcePersistentDisk kubernetes volume is very slow
  • FROM node:6.6.0
    RUN mkdir -p /usr/src/app
    WORKDIR /usr/src/app
    ONBUILD COPY package.json /usr/src/app/
    ONBUILD RUN npm install
    ONBUILD COPY . /usr/src/app
    CMD [ "npm", "start" ]

  • Java Spring will not talk to Consul when run as a Docker container
  • Docker(compose) installing nodejs broke npm
  • Merge container files when using docker-sync
  • How do I pull Docker images from the Tutum private registry with Amazon ECS?
  • How to override the default value of COMPOSE_HTTP_TIMEOUT with docker-compose commnad
  • View logs for all docker containers simultaneously
  • 2 Solutions collect form web for “Can you change the CMD of the node layer – Docker”

    Or you can create a new image from the base and just specify a new CMD:

    FROM <image-which-does-almost-exactly-what-i-want>
    CMD ["my", "replacement", "command"]

    When you build your image, you can run it directly without adding a new command at the end. When the base image changes, just rebuild yours and you’ll get all the updates.

    Yes, just type the command you want to run at the end of docker run.

    docker run <yourimage> <yourcommand>
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.