'How can I view Html pages from inside a docker container?

I have a docker container with its own file structure. Inside it there are some html files that I am interested in viewing. How can I view these html files correctly?

(Right now in vscode I can only see the html code)



Solution 1:[1]

You might need to install editor inside the container, and then you can use that editor to view your HTML source code.

Here are the commands for the same:

  1. docker exec -u 0 -it <container_id> /bin/bash
  2. apt-get update
  3. apt-get install vim

Hope this would help.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 techStud