Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Podman for DevOps

You're reading from   Podman for DevOps Containerization reimagined with Podman and its companion tools

Arrow left icon
Product type Paperback
Published in Apr 2022
Publisher Packt
ISBN-13 9781803248233
Length 518 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Gianni Salinetti Gianni Salinetti
Author Profile Icon Gianni Salinetti
Gianni Salinetti
Alessandro Arrichiello Alessandro Arrichiello
Author Profile Icon Alessandro Arrichiello
Alessandro Arrichiello
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: From Theory to Practice: Running Containers with Podman
2. Chapter 1: Introduction to Container Technology FREE CHAPTER 3. Chapter 2: Comparing Podman and Docker 4. Chapter 3: Running the First Container 5. Chapter 4: Managing Running Containers 6. Chapter 5: Implementing Storage for the Container's Data 7. Section 2: Building Containers from Scratch with Buildah
8. Chapter 6: Meet Buildah – Building Containers from Scratch 9. Chapter 7: Integrating with Existing Application Build Processes 10. Chapter 8: Choosing the Container Base Image 11. Chapter 9: Pushing Images to a Container Registry 12. Section 3: Managing and Integrating Containers Securely
13. Chapter 10: Troubleshooting and Monitoring Containers 14. Chapter 11: Securing Containers 15. Chapter 12: Implementing Container Networking Concepts 16. Chapter 13: Docker Migration Tips and Tricks 17. Chapter 14: Interacting with systemd and Kubernetes 18. Other Books You May Enjoy

Building images from a Dockerfile

As we described earlier in this chapter, the Dockerfile can be an easy option to create and share the build steps for creating a container image, and for this reason, it is really easy to find a lot of source Dockerfiles on the net.

The first step of this activity is to build a simple Dockerfile to work with. Let's create a Dockerfile for creating a containerized web server:

# mkdir webserver
# cd webserver/
[webserver]# vi Dockerfile 
[webserver]# cat Dockerfile
# Start from latest fedora container base image
FROM fedora:latest
MAINTAINER podman-book  # this should be an email
# Update the container base image
RUN echo "Updating all fedora packages"; dnf -y update; dnf -y clean all
# Install the httpd package
RUN echo "Installing httpd"; dnf -y install httpd
# Expose the http port 80
EXPOSE 80
# Set the default command to run once the container will be started
CMD ["/usr/sbin/httpd", "-DFOREGROUND...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image