New answers tagged

2

The "official" nginx image has a specific path where it looks for files. You can either copy a file into the image by creating a new image from it or mount your files into this path as a volume. To copy files, have a folder with your index.html and a Dockerfile that looks like this: FROM nginx COPY index.html /usr/share/nginx/html Then build a new ...


0

running and copying files into the container: root@mordor:~# root@mordor:~# sudo docker run --name docker-nginx -p 80:80 -d nginx 29b4280504c2d46c10b8459de0844ba30bce0c1bc97b70521c3f812f29d17c27 root@mordor:~# root@mordor:~# docker cp index.html docker-nginx:/indx.html root@mordor:~# root@mordor:~# docker exec -it docker-nginx bash root@29b4280504c2:/# ...


1

Did you only try to reach localhost? Or even 0.0.0.0 or 127.0.0.1? Depending on the operating system, docker config and the internal networking setup, some problem can occurs to reach the docker network. You can inspect the container to get the network IP, maybe you can go there https://stackoverflow.com/a/20686101/2904965


Top 50 recent answers are included