After running:
docker run -d nodeapi -p 49160:3000
The container doesnt start and when I look at docker logs I see the error:
[eval]:1
49160:3000
SyntaxError: Unexpected token :
Here's my Dockerfile:
FROM node:10
WORKDIR /usr/app
COPY package.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
edit: I'm running that on Windows 10 via Docker Toolbox
The -p 49160:3000
needs to be before the container image nodeapi
. The way you have it, -p 49160:3000
is passed to the container's npm start
as if it were command-line flags|params. Clearly, it doesn't like the colon.
So.
docker run --detach --publish 49160:3000 nodeapi
While you debug, it may be preferable to run the container interactively:
docker run --interactive --tty --publish=49160:3000 nodeapi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With