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

278
Vistas
Docker does not copy over updated files when building

My dockerfile:

FROM nginx:1.15.8-alpine

#config
copy ./nginx.conf /etc/nginx/nginx.conf
copy ./html/ /usr/share/nginx/html/

How I run it:

docker rm -vf $(docker ps -a -q)
docker rmi -f $(docker images -a -q)
docker build --no-cache . -t netvis
docker run -it -p 8081:80 netvis

Hi!

When I update files in the html/ directory on the local machine and then run the build commands the files are not updated in the docker container.

I have been told that the solution to this problem is to use the --no-cache option when building, which didn't work and to run the two deletion commands before the build command which also didn't work.

I have also tried restarting docker and also running "docker system prune -a" which also didn't work.

Thanks for any help!

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

So, per my comments, using COPY:

# Latest version is v1.21.1
FROM nginx:1.21.1-alpine

COPY ./html/ /usr/share/nginx/html/

NOTE I just used html and left the config unchanged.

rm -rf ./html
mkdir ./html
echo '<html><body>Hello Freddie</body></html>' > ./html/index.html

docker build \
--tag=68856201:v1 \
--file=./Dockerfile \
.

docker run \
--interactive --tty --rm \
--publish=8081:80 \
68856201:v1

Then from another shell:

curl localhost:8081/index.html
<html><body>Hello Freddie</body></html>
over 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