There is a web server container running.
You need to edit its index.html
file without restarting the container:
- Replace the phrase "Hello World" with the phrase "Hello Labs".
- Add the phrase "Practice for the win!" to any place in the file.
The file is located in the /var/www/html
directory.
Hint 1 π‘
Do you really need a hint? It's an easy one π There is a whole bunch of ways to edit a file in a running container. Can you think of a few?
Hint 2 π‘
Since the editing requirements are relatively simple in this particular case,
you can use docker exec sed
and the like to edit the file right in the container.
Hint 3 π‘
Not the most secure way,
but you can start an interactive shell in the container using docker exec -it sh
and install the editor of your choice (e.g. vim
or nano
) to the running container.
Hint 4 π‘
The most boring way it to copy the file to your host machine, edit it there using your favorite IDE, and then copy it back.
You can use docker cp
to copy files from and to the container.
Level up your Server Side game β Join 9,000 engineers who receive insightful learning materials straight to their inbox