Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

279
Views
Docker no copia los archivos actualizados al compilar

Mi archivo acoplable:

 FROM nginx:1.15.8-alpine #config copy ./nginx.conf /etc/nginx/nginx.conf copy ./html/ /usr/share/nginx/html/

Cómo lo ejecuto:

 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

¡Hola!

Cuando actualizo archivos en el directorio html/ en la máquina local y luego ejecuto los comandos de compilación, los archivos no se actualizan en el contenedor acoplable.

Me dijeron que la solución a este problema es usar la opción --no-cache al compilar, que no funcionó, y ejecutar los dos comandos de eliminación antes del comando de compilación, que tampoco funcionó.

También intenté reiniciar la ventana acoplable y también ejecutar "docker system prune -a", que tampoco funcionó.

¡Gracias por cualquier ayuda!

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Entonces, según mis comentarios, usando COPY :

 # Latest version is v1.21.1 FROM nginx:1.21.1-alpine COPY ./html/ /usr/share/nginx/html/

NOTA Acabo de usar html y dejé la configuración sin cambios.

 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

Luego desde otro caparazón:

 curl localhost:8081/index.html <html><body>Hello Freddie</body></html>
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!