Line 19: | Line 19: | ||
podman run -it registry.fedoraproject.org/fedora:latest echo Hello-World | podman run -it registry.fedoraproject.org/fedora:latest echo Hello-World | ||
= Create a container from | = Create a container from a Containerfile = | ||
For this test you can use a | For this test you can use a Containerfile of your own or use this basic example below: | ||
<pre> | <pre> | ||
cat << EOF >> | cat << EOF >> Containerfile | ||
FROM registry.fedoraproject.org/fedora:latest | FROM registry.fedoraproject.org/fedora:latest | ||
RUN /usr/bin/dnf install -y httpd | RUN /usr/bin/dnf install -y httpd | ||
Line 32: | Line 32: | ||
Build an image | Build an image | ||
podman build -t fedora-httpd $(pwd) | |||
Verify the image | Verify the image | ||
podman images | |||
Run the container | Run the container | ||
podman run -d -p 1080:80 localhost/fedora-httpd | |||
Verify the container is running | Verify the container is running | ||
podman container ls | |||
Test apache is working, this should display the Test page html. | Test apache is working, this should display the Test page html. | ||
curl http://localhost | curl http://localhost:1080 | ||
Open the firewall to accept connections on port 80 | Open the firewall to accept connections on port 80 and forward to port 1080 | ||
firewall-cmd | sudo firewall-cmd --add-forward-port=port=80:proto=tcp:toport=1080 --permanent | ||
Revision as of 03:05, 27 May 2021
Description
A simple validation test case for Podman on Fedora IoT Edition.
Setup
This testcase can be run on either an image or installation, on hardware or in virtualization.
How to test
Boot image or Installation and log in locally or SSH into booted image. For this test, use a regular user account to ensure rootless podman is working.
Check if podman is installed
rpm -q podman
Check to see if you can pull an image from the registry
podman pull registry.fedoraproject.org/fedora:latest
Note when testing aarch64 you may need to include '--override-arch arm64' due to this bug
Run hello-world to test.
podman run -it registry.fedoraproject.org/fedora:latest echo Hello-World
Create a container from a Containerfile
For this test you can use a Containerfile of your own or use this basic example below:
cat << EOF >> Containerfile FROM registry.fedoraproject.org/fedora:latest RUN /usr/bin/dnf install -y httpd EXPOSE 80 CMD ["-D", "FOREGROUND"] ENTRYPOINT ["/usr/sbin/httpd"] EOF
Build an image
podman build -t fedora-httpd $(pwd)
Verify the image
podman images
Run the container
podman run -d -p 1080:80 localhost/fedora-httpd
Verify the container is running
podman container ls
Test apache is working, this should display the Test page html.
curl http://localhost:1080
Open the firewall to accept connections on port 80 and forward to port 1080
sudo firewall-cmd --add-forward-port=port=80:proto=tcp:toport=1080 --permanent
Open a web browser on another computer and enter the IP address to test the page is visible.
Results
- Latest image pulled successfully from the Registry
- podman is installed
- Hello World is displayed
- Custom container created, httpd test page visible on a browser or using curl.