You've already forked devops-exercises
Rename exercises dir
Name it instead "topics" so it won't be strange if some topics included "exercises" directory.
This commit is contained in:
35
topics/containers/solutions/sharing_images.md
Normal file
35
topics/containers/solutions/sharing_images.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Sharing Images
|
||||
|
||||
## Requirements
|
||||
|
||||
Have at least one image locally (run `podman image ls` to confirm).<br>
|
||||
If you don't have images locally, run simply `podman pull httpd`.
|
||||
|
||||
## Objectives
|
||||
|
||||
1. Choose an image and create an archive out of it
|
||||
2. Check the archive size. Is it different than the image size? If yes, what's the difference? If not, why?
|
||||
3. Copy the generated archive to a remote host
|
||||
4. Load the image
|
||||
5. Verify it was loaded and exists on the remote host
|
||||
|
||||
## Solution
|
||||
|
||||
```
|
||||
# Save image as an archive
|
||||
podman save -o httpd.tar httpd
|
||||
|
||||
# Check archive and image sizes
|
||||
du -sh httpd.tar # output: 143MB
|
||||
podman image ls | grep httpd # output: 149MB
|
||||
# The archive is obviously smaller than the image itself (6MB difference)
|
||||
|
||||
# Copy the archive to a remote host
|
||||
rsync -azc httpd.tar USER@REMOTE_HOST_FQDN:/tmp/
|
||||
|
||||
# Load the image
|
||||
podman load -i /tmp/httpd.tar
|
||||
|
||||
# Verify it exists on the system after loading
|
||||
podman image ls
|
||||
```
|
||||
Reference in New Issue
Block a user