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.

  • Generic Docker Image and Dockerfile for SpringBoot Apps using Gradle
  • HAproxy acl rewrite not working without trailing slash
  • Docker exec versus nsenter: Any gotchas?
  • How does .NET Core on Linux determine what port a SQL Server instance listens on?
  • Docker: mounting volume and run node apps
  • How to access nodemon log on running docker 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" ]
    

  • Container does not start if I map existing in container dir
  • Issue with docker-py in executing /bin/bash
  • Kubernetes: spec.clusterIP: invalid value?
  • Docker - exposing IP addresses to DNS server
  • Docker + rails 4 :, weird error during : RUN bundle exec rake assets:precompile
  • Rails engine apps deployed with docker
  • 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.