Build UBI-based images
You can create a UBI-based web server container from a Containerfile by using the Buildah utility. You have to disable all non-UBI DNF repositories to ensure that your image contains only Red Hat software that you can redistribute.
Before you begin
- The
container-toolsmeta-package is installed.
About this task
For UBI minimal images, use microdnf instead of dnf:
RUN microdnf update -y && rm -rf /var/cache/yum and
RUN microdnf install httpd -y && microdnf clean all commands.
Procedure
Results
- Run the web server:
# podman run -d --name=myweb -p 80:80 johndoe/webserverbbe98c71d18720d966e4567949888dc4fb86eec7d304e785d5177168a5965f64 - Test the web server:
# curl http://localhost/index.htmlThe Web Server is Running