Add initial scripts and configuration for Fedora image build process
- Create .gitignore to exclude output directory - Add Containerfile for building Fedora image with necessary configurations - Implement build-iso.sh for ISO generation - Implement build.sh for building the image - Implement push-image.sh for pushing the built image to Docker Hub
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
output/
|
||||||
60
Containerfile
Normal file
60
Containerfile
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
FROM registry.fedoraproject.org/fedora-bootc:42
|
||||||
|
|
||||||
|
#Langue FR par défaut
|
||||||
|
RUN echo "LANG=fr_FR.UTF-8" > /etc/locale.conf
|
||||||
|
RUN echo "KEYMAP=fr" > /etc/vconsole.conf
|
||||||
|
RUN ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
|
||||||
|
|
||||||
|
#Ajout du dépot vscode
|
||||||
|
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
|
||||||
|
&& echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\nautorefresh=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | tee /etc/yum.repos.d/vscode.repo > /dev/null
|
||||||
|
|
||||||
|
#Install de gnome avec support hardware + Podman + Cups + Vulkan driver + Plymouth
|
||||||
|
RUN dnf install -y \
|
||||||
|
@gnome-desktop \
|
||||||
|
@hardware-support \
|
||||||
|
@development-tools \
|
||||||
|
code \
|
||||||
|
glibc-langpack-fr \
|
||||||
|
flatpak \
|
||||||
|
buildah \
|
||||||
|
podman \
|
||||||
|
podman-docker \
|
||||||
|
fuse-overlayfs \
|
||||||
|
cups \
|
||||||
|
dconf \
|
||||||
|
cups-pdf \
|
||||||
|
vulkan-loader \
|
||||||
|
vulkan-tools \
|
||||||
|
mesa-vulkan-drivers \
|
||||||
|
plymouth \
|
||||||
|
plymouth-system-theme \
|
||||||
|
plymouth-plugin-label \
|
||||||
|
plymouth-plugin-fade-throbber \
|
||||||
|
podman-compose \
|
||||||
|
&& dnf remove -y gnome-software gnome-software-rpm-ostree || true \
|
||||||
|
&& dnf clean all \
|
||||||
|
&& rm -rf /var/cache/dnf
|
||||||
|
|
||||||
|
|
||||||
|
#Configuration des fenêtres gnome pour avoir les btns style windows
|
||||||
|
RUN mkdir -p /etc/dconf/db/local.d /etc/dconf/profile && \
|
||||||
|
printf "[org/gnome/desktop/wm/preferences]\nbutton-layout=':minimize,maximize,close'\n" > /etc/dconf/db/local.d/02-window-buttons && \
|
||||||
|
printf "user-db:user\nsystem-db:local\n" > /etc/dconf/profile/user && \
|
||||||
|
dconf update 2>/dev/null || true
|
||||||
|
|
||||||
|
# Configuration Plymouth (thème spinner par défaut)
|
||||||
|
RUN plymouth-set-default-theme spinner && \
|
||||||
|
dracut -f
|
||||||
|
|
||||||
|
# Configuration pour flatpak
|
||||||
|
RUN echo "user.max_user_namespaces=28633" > /etc/sysctl.d/userns.conf
|
||||||
|
|
||||||
|
# Ajout de flathub avec des apps par défaut
|
||||||
|
RUN flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo \
|
||||||
|
&& flatpak install -y --system flathub runtime/org.gnome.Platform/x86_64/49 \
|
||||||
|
&& flatpak install -y --system flathub io.github.kolunmi.Bazaar
|
||||||
|
|
||||||
|
#Activation des services
|
||||||
|
RUN systemctl preset-all && \
|
||||||
|
systemctl enable gdm.service NetworkManager.service bluetooth.service podman.socket cups.service
|
||||||
29
build-iso.sh
Executable file
29
build-iso.sh
Executable file
@@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
IMAGE_NAME="tintounn/my-fedora"
|
||||||
|
IMAGE_TAG="latest"
|
||||||
|
OUTPUT_DIR="output/"
|
||||||
|
|
||||||
|
bash build.sh
|
||||||
|
|
||||||
|
echo "[INFO] Génération ISO pour ${IMAGE_NAME}:${IMAGE_TAG}..."
|
||||||
|
|
||||||
|
# Nettoyage ancien répertoire
|
||||||
|
sudo rm -rf "$OUTPUT_DIR"
|
||||||
|
mkdir -p "$OUTPUT_DIR"
|
||||||
|
|
||||||
|
# Génération de l'ISO directement depuis le storage root
|
||||||
|
sudo podman run --rm -it \
|
||||||
|
--privileged \
|
||||||
|
--pull=newer \
|
||||||
|
--security-opt label=type:unconfined_t \
|
||||||
|
-v $(pwd)/output:/output \
|
||||||
|
-v /var/lib/containers/storage:/var/lib/containers/storage \
|
||||||
|
quay.io/centos-bootc/bootc-image-builder:latest \
|
||||||
|
--type anaconda-iso \
|
||||||
|
--local \
|
||||||
|
--rootfs xfs \
|
||||||
|
localhost/${IMAGE_NAME}:${IMAGE_TAG}
|
||||||
|
|
||||||
|
echo "[SUCCÈS] ISO généré dans $OUTPUT_DIR"
|
||||||
10
build.sh
Executable file
10
build.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
IMAGE_NAME="tintounn/my-fedora"
|
||||||
|
IMAGE_TAG="latest"
|
||||||
|
OUTPUT_DIR="output/"
|
||||||
|
|
||||||
|
echo "[INFO] Build de l'image avec sudo..."
|
||||||
|
sudo buildah bud -t localhost/${IMAGE_NAME}:${IMAGE_TAG} .
|
||||||
|
|
||||||
13
push-image.sh
Executable file
13
push-image.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
IMAGE_NAME="tintounn/my-fedora"
|
||||||
|
IMAGE_TAG="latest"
|
||||||
|
OUTPUT_DIR="output/"
|
||||||
|
|
||||||
|
bash build.sh
|
||||||
|
|
||||||
|
echo "[INFO] Push de l'image ${IMAGE_NAME}:${IMAGE_TAG}"
|
||||||
|
|
||||||
|
sudo buildah tag localhost/${IMAGE_NAME}:${IMAGE_TAG} docker.io/${IMAGE_NAME}:${IMAGE_TAG}
|
||||||
|
sudo buildah push docker.io/${IMAGE_NAME}:${IMAGE_TAG}
|
||||||
Reference in New Issue
Block a user