Ubuntu 22.04
Sponsored Link

Buildah : स्क्रैच से चित्र बनाएं2023/09/04

 
एक खाली कंटेनर छवि से कंटेनर छवियां बनाएं।
[1] [scratch] छवि से बनाना प्रारंभ करें।
# [scratch] के साथ एक खाली कंटेनर बनाएं

root@dlp:~#
newcontainer=$(buildah from scratch)

root@dlp:~#
buildah containers

CONTAINER ID  BUILDER  IMAGE ID     IMAGE NAME                       CONTAINER NAME
874af682530f     *     2dc39ba059dc docker.io/library/ubuntu:latest  ubuntu-working-container
9ae231095c55     *     2dc39ba059dc docker.io/library/ubuntu:latest  ubuntu-working-container-1
d39c57e6b9e0     *                  scratch                          working-container

# माउंट [scratch] कंटेनर

root@dlp:~#
scratchmnt=$(buildah mount $newcontainer)

root@dlp:~#
echo $scratchmnt

/var/lib/containers/storage/overlay/f4760a70c2108d28b6a57a23ccc46d0a0c2179eca915b20605e27a9a182efd3f/merged

# [scratch] कंटेनर में पैकेज स्थापित करें

root@dlp:~#
apt -y install debootstrap

root@dlp:~#
debootstrap jammy $scratchmnt

# अनमाउंट

root@dlp:~#
buildah umount $newcontainer

d39c57e6b9e04f1f3e42acba73bbd949efc749dee1882d8453a0924509718a80

# कंटेनर चलाएँ

root@dlp:~#
buildah run $newcontainer cat /etc/os-release

PRETTY_NAME="Ubuntu 22.04 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04 (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

# छवि जोड़ें

root@dlp:~#
buildah commit $newcontainer ubuntu-basic:latest

Getting image source signatures
Copying blob c755a751394a done
Copying config bd3e7ec3b9 done
Writing manifest to image destination
Storing signatures
bd3e7ec3b902d468f990e5c6474674712ad2fac0e6f09bd6ed8533b63724c103

root@dlp:~#
buildah images

REPOSITORY                 TAG      IMAGE ID       CREATED          SIZE
localhost/ubuntu-basic     latest   bd3e7ec3b902   34 seconds ago   386 MB
localhost/my-ubuntu        latest   03c58cc53f05   18 minutes ago   147 MB
docker.io/library/ubuntu   latest   2dc39ba059dc   4 hours ago      80.4 MB

# एक कंटेनर चलाने के लिए परीक्षण करें

root@dlp:~#
podman run localhost/ubuntu-basic /bin/echo "Hello my ubuntu"

Hello my debian
मिलान सामग्री