title: Overriding docker cmd when docker run
body: <p>I am dockerizing a node application.</p>
  
  <p>This is the Dockerfile that I am using:</p>
  
  <pre><code>FROM node:10-slim
  
  # Sets environment variable
  ENV NODE_ENV production
  
  # Sets work directory
  WORKDIR /usr/src/app
  
  # Copy package.json
  COPY ["package.json", "./"]
  
  # Installs dependencies 
  RUN npm install
  
  # Copy working files
  COPY . /usr/src/app
  
  EXPOSE 80
  
  # Starts run command
  CMD npm start
  </code></pre>
  
  <p>But then, since I have several .env files, I would like to pass an argument to choose which env file I will use.</p>
  
  <p>Like this</p>
  
  <pre><code>npm start -- --env="test" 
  </code></pre>
  
  <p>So what I ultimately want is </p>
  
  <pre><code>docker run -p 8080:8080 test/nodeapp:1.0 -- -evn="test" 
  </code></pre>
  
  <p>How should I override the <code>CMD</code> on docker run?</p>