From Fedora Project Wiki
No edit summary
No edit summary
Line 23: Line 23:
For this test you can install the Fedora dockerfiles package (rpm-ostree install fedora-dockerfiles) or use the example dockerfile below:
For this test you can install the Fedora dockerfiles package (rpm-ostree install fedora-dockerfiles) or use the example dockerfile below:
<pre>
<pre>
vi Dockerfile
cat << EOF >> Dockerfile
FROM fedora:latest
FROM fedora:latest
RUN /usr/bin/dnf install -y httpd
RUN /usr/bin/dnf install -y httpd
Line 29: Line 29:
CMD ["-D", "FOREGROUND"]
CMD ["-D", "FOREGROUND"]
ENTRYPOINT ["/usr/sbin/httpd"]
ENTRYPOINT ["/usr/sbin/httpd"]
EOF
</pre>
</pre>



Revision as of 21:04, 11 March 2019

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.

Check if podman is installed

 rpm -q podman

Check to see if you can pull an image from the registry

podman pull fedora

Run hello-world to test

podman run -it fedora echo Hello-World

Basic image test

podman run -it --rm fedora bash

Optional custom container

For this test you can install the Fedora dockerfiles package (rpm-ostree install fedora-dockerfiles) or use the example dockerfile below:

cat << EOF >> Dockerfile
FROM fedora:latest
RUN /usr/bin/dnf install -y httpd
EXPOSE 80
CMD ["-D", "FOREGROUND"]
ENTRYPOINT ["/usr/sbin/httpd"]
EOF

Build an image

sudo podman build -t f29-httpd $(pwd)

Verify the image

podman images

Run container

podman run -d -p 80:80 localhost/f29-httpd

Firewalld commands

firewall-cmd --permanent --zone=trusted --add-interface=cni0
firewall-cmd --permanent --zone=trusted --add-port=80/tcp

Test apache is working

curl http://localhost/

Open a web browser and test the page is visible

Results

  1. Latest image pulled successfully from the Registry
  2. podman is installed
  3. Hello World is displayed
  4. Image booted to a bash shell
  5. Custom container created, httpd test page visible on a browser or using curl.