I'm trying to dockerize a basic nodejs app. My dockerfile is the follow
FROM node:10
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 80
CMD [ "node", "index.js" ]
After i build the image I'm trying to running it with
docker run -p 3000:3000 imagename -e connectionString=myConnString
But I received always the same error
[eval]:1
connectionString=myConnString
ReferenceError: myConnString is not defined
How can I solve?
-e connectionString=myConnStringshould be passed in thedocker runi.e.docker run -p 3000:3000 -e connectionString=myConnString imagename- anything passed after theimage:tagis passed as[COMMAND] [ARG...]to theENTRYPOINT(if any) ref. the doc.