-1

i am trying to create a running container and inside that container i want to give a content to test.html which should be in /var/www/html. I should do it by echo command inside the container. Problem is that even after downloading nginx container, i cant find /var/www/html inside the container so lately, when i try to reach for it... i cant of course. I need to use nginx image. I wanted to use httpd container, but i cant, thats why i am asking. Basically i should run the container with command like that

sudo podman run -d --name nginx -p 8180:80 nginx

or

sudo podman run -d --name nginx -p 8180:80 usgs/nginx

Lets imagine i will have /var/www/html in container, i will then do

echo "test text" > /var/www/html/test.html exit from container and do curl command in my host terminal curl 127.0.0.1:8180/test.html test text

Just to show you, what i need to get.

igorov
  • 1
  • 2
  • You probably want to build a custom Image that `COPY`s in the content you need. Don't try to edit files in a running container; your changes will be lost as soon as the container exits. – David Maze Jan 15 '21 at 19:01
  • I FOUND ANSWER! The problem is, that nginx index.html is in /usr/share/nginx/html and nto in /var/www/html, so basically i used the .html files in /usr/share/nginx/html in order to get content from curl 127.0.0.1:8180/test.html. I guess you can close it, guys. – igorov Jan 15 '21 at 19:11

1 Answers1

-1

I FOUND ANSWER! The problem is, that nginx index.html is in /usr/share/nginx/html and nto in /var/www/html, so basically i used the .html files in /usr/share/nginx/html in order to get content from curl 127.0.0.1:8180/test.html. I guess you can close it, guys.

igorov
  • 1
  • 2