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 openerp can not start - stop
  • How to make host interfaces, including cni* accessible in kubernetes privileged pods?
  • Start up docker container without dockerfile
  • combining cloudbees ec2 docker image with docker in docker
  • Create a volume in docker from windows host
  • How to share localhost between two different Docker containers?
  • FROM node:6.6.0
    
    RUN mkdir -p /usr/src/app
    WORKDIR /usr/src/app
    
    ONBUILD ARG NODE_ENV
    ONBUILD ENV NODE_ENV $NODE_ENV
    ONBUILD COPY package.json /usr/src/app/
    ONBUILD RUN npm install
    ONBUILD COPY . /usr/src/app
    
    CMD [ "npm", "start" ]
    

  • Persistent Data when Scaling Postgres with Citus and Docker Compose
  • Shell script to cleanup specified docker containers using grep
  • MeteorD container starting failed
  • how to sync mac local directory with native docker container?
  • ssh-add does not work inside docker image
  • Unsupported config option for services service: 'httpd'
  • 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.