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

Copying files in and out of a container

Podman enables users to move files into and out of a running container. This result is achieved using the podman cp command, which can move files and folders to and from a container. Its usage is quite simple and will be illustrated in the next example.

First, let's start a new Alpine container:

$ podman run -d --name alpine_cp_test alpine sleep 1000

Now, let's grab a file from the container – we have chosen the /etc/os-release file, which provides some information about the distribution and its version ID:

$ podman cp alpine_cp_test:/etc/os-release /tmp

The file has been copied to the host /tmp folder and can be inspected:

$ cat /tmp/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.14.2
PRETTY_NAME="Alpine Linux v3.14"
HOME_URL=https://alpinelinux.org/
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

In the opposite direction, we can copy files or folders from the host to...

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