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!
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
htmland 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>