Have at least one image locally (run podman image ls
to confirm).
If you don't have images locally, run simply podman pull nginx:alpine
.
- Run a container using a web server image (e.g. httpd, nginx, ...)
- Bind container's port 80 to local port 80
- Run it in detached mode
- Name should nginx_container
- Verify the web server runs and accessible
- Create an HTML file with the following content and copy it to the container to the container to path where it will be accessed as an index file
<html>
<head>
<title>It's a me</title>
</head>
<body>
<h1>Mario</h1>
</body>
- Create an image out of the running container and call it "nginx_mario"
- Tag the container with "mario" tag
- Remove the original container (container_nginx) and verify it was removed
- Create a new container out of the image you've created (the same way as the original container)
- Run
curl 127.0.0.1:80
. What do you see? - Run
podman diff
on the new image. Explain the output