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.

  • How to create a superuser in Django with Linux shell script?
  • How can I configure logtash to use “stdout” as input?
  • Docker Golang onbuild custom action at docker run
  • What does the command gcloud docker -a do?
  • CentOS7 Docker login/ pull x509: certificate signed by unknown authority
  • Docker: communication between web container and php container
  • 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" ]
    

  • What is a sparse block device at /dev/xvdf
  • nginx/apache redirection for output port on docker container on vps
  • How can I check that Openwhisk gets invoked?
  • graphql and serverless offline running in docker
  • Can not load libjli.so in docker container
  • What is the default admin password for DRONE_ADMIN users?
  • 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.