From 150e7d5715d67fbd3917b1d27d78cc46ff60b3e6 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Sun, 19 Nov 2023 15:51:45 -0800 Subject: [PATCH 1/2] chore: First pass of DX images --- .github/workflows/build.yml | 2 +- Containerfile | 50 +++++++++++++++++++ .../dx/etc/yum.repos.d/docker-ce.repo | 6 +++ system_files/dx/etc/yum.repos.d/vscode.repo | 6 +++ .../etc/profile.d/vscode-bazzite-profile.sh | 7 +++ .../skel.d/.config/Code/User/settings.json | 6 +++ .../dx/usr/lib/sysctl.d/docker-ce.conf | 1 + 7 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 system_files/dx/etc/yum.repos.d/docker-ce.repo create mode 100644 system_files/dx/etc/yum.repos.d/vscode.repo create mode 100644 system_files/dx/usr/etc/profile.d/vscode-bazzite-profile.sh create mode 100644 system_files/dx/usr/etc/skel.d/.config/Code/User/settings.json create mode 100644 system_files/dx/usr/lib/sysctl.d/docker-ce.conf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8a295e289..81013a0188 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: fail-fast: false matrix: image_flavor: [main, nvidia, asus, asus-nvidia, framework, surface, surface-nvidia] - base_name: [bazzite, bazzite-deck] + base_name: [bazzite, bazzite-deck, bazzite-dx] base_image_name: [kinoite, silverblue] major_version: [39] include: diff --git a/Containerfile b/Containerfile index ffc0091932..fc13064402 100644 --- a/Containerfile +++ b/Containerfile @@ -495,3 +495,53 @@ RUN /tmp/image-info.sh && \ mkdir -p /var/lib/bluetooth && \ chmod -R 755 /var/lib/bluetooth && \ ostree container commit + +FROM bazzite as bazzite-dx + +ARG IMAGE_NAME="${IMAGE_NAME}" +ARG IMAGE_VENDOR="${IMAGE_VENDOR}" +ARG IMAGE_FLAVOR="${IMAGE_FLAVOR}" +ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}" +ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}" + +COPY system_files/deck/shared system_files/deck/${BASE_IMAGE_NAME} / + +# Apply IP Forwarding before installing Docker to prevent messing with LXC networking +RUN sysctl -p && \ + wget https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 -O /tmp/docker-compose && \ + install -c -m 0755 /tmp/docker-compose /usr/bin + +COPY --from=cgr.dev/chainguard/flux:latest /usr/bin/flux /usr/bin/flux +COPY --from=cgr.dev/chainguard/helm:latest /usr/bin/helm /usr/bin/helm +COPY --from=cgr.dev/chainguard/ko:latest /usr/bin/ko /usr/bin/ko +COPY --from=cgr.dev/chainguard/minio-client:latest /usr/bin/mc /usr/bin/mc +COPY --from=cgr.dev/chainguard/kubectl:latest /usr/bin/kubectl /usr/bin/kubectl + +RUN curl -Lo ./kind "https://github.com/kubernetes-sigs/kind/releases/latest/download/kind-$(uname)-amd64" && \ + chmod +x ./kind && \ + mv ./kind /usr/bin/kind + +# Install DevPod +RUN rpm-ostree install https://github.com/loft-sh/devpod/releases/download/v0.3.7/DevPod_linux_x86_64.rpm && \ + wget https://github.com/loft-sh/devpod/releases/download/v0.3.7/devpod-linux-amd64 -O /tmp/devpod && \ + install -c -m 0755 /tmp/devpod /usr/bin + +# Install kns/kctx and add completions for Bash +RUN wget https://raw.githubusercontent.com/ahmetb/kubectx/master/kubectx -O /usr/bin/kubectx && \ + wget https://raw.githubusercontent.com/ahmetb/kubectx/master/kubens -O /usr/bin/kubens && \ + chmod +x /usr/bin/kubectx /usr/bin/kubens + +# Cleanup & Finalize +COPY system_files/shared / +RUN /tmp/image-info.sh && \ + systemctl enable podman.socket && \ + systemctl disable pmie.service && \ + systemctl disable pmlogger.service && \ + rm -rf \ + /tmp/* \ + /var/* && \ + mkdir -p /var/tmp && \ + chmod -R 1777 /var/tmp && \ + mkdir -p /var/lib/bluetooth && \ + chmod -R 755 /var/lib/bluetooth && \ + ostree container commit \ No newline at end of file diff --git a/system_files/dx/etc/yum.repos.d/docker-ce.repo b/system_files/dx/etc/yum.repos.d/docker-ce.repo new file mode 100644 index 0000000000..8a0de16042 --- /dev/null +++ b/system_files/dx/etc/yum.repos.d/docker-ce.repo @@ -0,0 +1,6 @@ +[docker-ce-stable] +name=Docker CE Stable - $basearch +baseurl=https://download.docker.com/linux/fedora/$releasever/$basearch/stable +enabled=1 +gpgcheck=1 +gpgkey=https://download.docker.com/linux/fedora/gpg diff --git a/system_files/dx/etc/yum.repos.d/vscode.repo b/system_files/dx/etc/yum.repos.d/vscode.repo new file mode 100644 index 0000000000..086c915547 --- /dev/null +++ b/system_files/dx/etc/yum.repos.d/vscode.repo @@ -0,0 +1,6 @@ +[code] +name=Visual Studio Code +baseurl=https://packages.microsoft.com/yumrepos/vscode +enabled=1 +gpgcheck=1 +gpgkey=https://packages.microsoft.com/keys/microsoft.asc diff --git a/system_files/dx/usr/etc/profile.d/vscode-bazzite-profile.sh b/system_files/dx/usr/etc/profile.d/vscode-bazzite-profile.sh new file mode 100644 index 0000000000..8cd7094223 --- /dev/null +++ b/system_files/dx/usr/etc/profile.d/vscode-bazzite-profile.sh @@ -0,0 +1,7 @@ +if test "$(id -u)" -gt "0" && test -d "$HOME"; then + # Add default settings when there are no settings + if test ! -e "$HOME"/.config/Code/User/settings.json; then + mkdir -p "$HOME"/.config/Code/User + cp -f /etc/skel.d/.config/Code/User/settings.json "$HOME"/.config/Code/User/settings.json + fi +fi diff --git a/system_files/dx/usr/etc/skel.d/.config/Code/User/settings.json b/system_files/dx/usr/etc/skel.d/.config/Code/User/settings.json new file mode 100644 index 0000000000..45b7a603e0 --- /dev/null +++ b/system_files/dx/usr/etc/skel.d/.config/Code/User/settings.json @@ -0,0 +1,6 @@ +{ + "dev.containers.dockerComposePath": "podman-compose", + "dev.containers.dockerPath": "podman", + "window.titleBarStyle": "custom", + "editor.fontFamily": "'CaskaydiaCove Nerd Font Mono', 'Droid Sans Mono', 'monospace', monospace" +} diff --git a/system_files/dx/usr/lib/sysctl.d/docker-ce.conf b/system_files/dx/usr/lib/sysctl.d/docker-ce.conf new file mode 100644 index 0000000000..4234b54305 --- /dev/null +++ b/system_files/dx/usr/lib/sysctl.d/docker-ce.conf @@ -0,0 +1 @@ +net.ipv4.ip_forward = 1 From 98a8d9b29d09dd4b2b18b6f522ef6dd7f285e2b4 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Sun, 19 Nov 2023 19:44:11 -0800 Subject: [PATCH 2/2] chore: Remove K8S, this is being moved to userspace on DX images --- Containerfile | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Containerfile b/Containerfile index fc13064402..90bfe50bce 100644 --- a/Containerfile +++ b/Containerfile @@ -515,22 +515,12 @@ COPY --from=cgr.dev/chainguard/flux:latest /usr/bin/flux /usr/bin/flux COPY --from=cgr.dev/chainguard/helm:latest /usr/bin/helm /usr/bin/helm COPY --from=cgr.dev/chainguard/ko:latest /usr/bin/ko /usr/bin/ko COPY --from=cgr.dev/chainguard/minio-client:latest /usr/bin/mc /usr/bin/mc -COPY --from=cgr.dev/chainguard/kubectl:latest /usr/bin/kubectl /usr/bin/kubectl - -RUN curl -Lo ./kind "https://github.com/kubernetes-sigs/kind/releases/latest/download/kind-$(uname)-amd64" && \ - chmod +x ./kind && \ - mv ./kind /usr/bin/kind # Install DevPod RUN rpm-ostree install https://github.com/loft-sh/devpod/releases/download/v0.3.7/DevPod_linux_x86_64.rpm && \ wget https://github.com/loft-sh/devpod/releases/download/v0.3.7/devpod-linux-amd64 -O /tmp/devpod && \ install -c -m 0755 /tmp/devpod /usr/bin -# Install kns/kctx and add completions for Bash -RUN wget https://raw.githubusercontent.com/ahmetb/kubectx/master/kubectx -O /usr/bin/kubectx && \ - wget https://raw.githubusercontent.com/ahmetb/kubectx/master/kubens -O /usr/bin/kubens && \ - chmod +x /usr/bin/kubectx /usr/bin/kubens - # Cleanup & Finalize COPY system_files/shared / RUN /tmp/image-info.sh && \