Add a couple of containers questions

This commit is contained in:
abregman
2022-07-02 01:12:45 +03:00
parent 738e582468
commit a9dc2202ca
8 changed files with 277 additions and 92 deletions

View File

@@ -0,0 +1,21 @@
# Containerized Web Server
1. Run a containerized web server in the background and bind its port (8080) to a local port
2. Verify the port (8080) is bound
3. Reach the webserver from your local host
## Solution
```
$ podman run -d -p 8080 httpd # run the container and bind the port 8080 to a local port
$ podman port -l 8080 # show to which local port the port 8080 on the container, binds to
0.0.0.0:41203
$ curl http://0.0.0.0:41203 # use the port from the output of the previous command
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Test Page for the HTTP Server on Red Hat Enterprise Linux</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
```

View File

@@ -2,7 +2,7 @@
### Objective
Learn how to run containers
Learn how to run, stop and remove containers
### Requirements