Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

323
Vistas
Docker: ENTRYPOINT can't execute command because it doesn't find the file

I'm trying to create a container from node js image and I have configured my Dockerfile as shown:

FROM node:boron

# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Install app dependencies
COPY package.json /usr/src/app
RUN npm install

# Bundle app source
COPY . /usr/src/app

VOLUME ./:/usr/src/app
ENTRYPOINT [ "npm run watch" ]

In the package.json I have a script called watch than runs the gulp task named watch-less.

If I run npm run watch in my local environment the command works but when I try running the container it doesn't and shows the next error:

docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"npm run watch\": executable file not found in $PATH".

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

ENTRYPOINT [ "npm run watch" ]

This is an incorrect json syntax, it's looking for the executable npm run watch, not the executable npm with parameters run and watch:

With the json syntax you need to separate each argument. You can use the shell syntax:

ENTRYPOINT npm run watch

Or you can update the json syntax like (assuming npm is installed in /usr/bin):

ENTRYPOINT [ "/usr/bin/npm", "run", "watch" ]

You also have an incorrect volume definition:

VOLUME ./:/usr/src/app

Dockerfiles cannot specify the how the volume is mounted to the host, only that an anonymous volume is defined at a specific directory location. With a syntax like:

VOLUME /usr/src/app

I've got strong opinions against using a volume definition inside of the Dockerfile described in this blog post. In short, you can define the volume better in a docker-compose.yml, all you can do with a Dockerfile is create anonymous volumes that you'd need to still redefine elsewhere if you want to be able to easily reuse them later.

about 4 years ago · Santiago Trujillo Denunciar

0

If you use the list notation for ENTRYPOINT, that is, with the [brackets], you must separate the arguments properly.

ENTRYPOINT ["npm", "run", "watch"]

Right now it is trying to find a file literally named "npm run watch" and that does not exist.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda