-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from rhatdan/main
Add demonstration of bootc
- Loading branch information
Showing
14 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM quay.io/centos-bootc/fedora-bootc:eln | ||
|
||
RUN dnf -y update; \ | ||
dnf -y install podman subscription-manager crun crun-wasm crun-krun chrony; \ | ||
dnf -y clean all; \ | ||
systemctl enable podman.service; \ | ||
printf "\nconfdir /etc/chrony.d\n" >> /etc/chrony.conf | ||
|
||
ADD usr usr | ||
ADD etc etc | ||
|
||
RUN systemctl enable rhsmcertd.service podman.socket | ||
|
||
RUN groupadd -g 501 core; useradd -u 501 -g 501 core | ||
USER core | ||
RUN systemctl --user enable podman.socket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
makestep 1 -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[engine] | ||
machine_enable=true |
1 change: 1 addition & 0 deletions
1
bootc/machine/etc/containers/registries.conf.d/999-podman-machine.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
unqualified-search-registries=["docker.io"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export DOCKER_HOST="unix://$(podman info -f "{{.Host.RemoteSocket.Path}}")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[containers] | ||
netns="bridge" | ||
pids_limit=0 |
1 change: 1 addition & 0 deletions
1
bootc/machine/etc/skel/.config/systemd/user/default.target.wants/linger-example.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../linger-example.service |
8 changes: 8 additions & 0 deletions
8
bootc/machine/etc/skel/.config/systemd/user/linger-example.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[Unit] | ||
Description", "A systemd user unit demo | ||
After=network-online.target | ||
Wants=network-online.target podman.socket | ||
|
||
[Service] | ||
ExecStart=/usr/bin/sleep infinity | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
core:100000:1000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
core:100000:1000000 |
2 changes: 2 additions & 0 deletions
2
bootc/machine/etc/systemd/system/[email protected]/delegate.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[Service] | ||
Delegate=memory pids cpu io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fs.inotify.max_user_instances=524288 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
L+ /run/docker.sock - - - - /run/user/501/podman/podman.sock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
#!/bin/sh | ||
|
||
# Setting up some colors for helping read the demo output. | ||
# Comment out any of the below to turn off that color. | ||
bold=$(tput bold) | ||
cyan=$(tput setaf 6) | ||
reset=$(tput sgr0) | ||
|
||
read_color() { | ||
read -p "${bold}$1${reset}" | ||
} | ||
|
||
exec_color() { | ||
echo -n " | ||
${bold}$ $1${reset}" | ||
read | ||
bash -c "$1" | ||
} | ||
|
||
echo_color() { | ||
echo "${cyan}$1${reset}" | ||
} | ||
|
||
IMAGE=quay.io/rhatdan/podman-machine | ||
clear | ||
exec_color "podman login quay.io" | ||
exec_color "cat machine/Containerfile.fcos" | ||
exec_color "podman build -t fcos -f machine/Containerfile.fcos machine/" | ||
exec_color "cat machine/Containerfile" | ||
exec_color "podman build --from fcos -t $IMAGE machine/" | ||
exec_color "podman run --rm -ti $IMAGE sh" | ||
clear | ||
exec_color "podman push $IMAGE" | ||
exec_color "sudo podman run --rm -it --privileged -v .:/output --pull newer quay.io/centos-bootc/bootc-image-builder --type qcow2 $IMAGE:latest" | ||
exec_color "sudo chown -R $UID:$UID qcow2" | ||
exec_color "mv qcow2/disk.qcow2 qcow2/$(basename $IMAGE).qcow2" |