Skip to content

Commit

Permalink
feat: enable -dx flavor of bluefin (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoceppi committed May 26, 2023
1 parent 05e9593 commit 98a4d23
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
merge_group:
workflow_dispatch:
env:
IMAGE_BASE_NAME: bluefin
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}

jobs:
Expand All @@ -24,6 +23,7 @@ jobs:
fail-fast: false
matrix:
image_flavor: [main, nvidia]
base_name: [bluefin, bluefin-dx]
major_version: [37, 38]
include:
- major_version: 37
Expand All @@ -40,9 +40,9 @@ jobs:
- name: Matrix Variables
run: |
if [[ "${{ matrix.image_flavor }}" == "main" ]]; then
echo "IMAGE_NAME=bluefin" >> $GITHUB_ENV
echo "IMAGE_NAME=${{ matrix.base_name }}" >> $GITHUB_ENV
else
echo "IMAGE_NAME=${{ format('{0}-{1}', env.IMAGE_BASE_NAME, matrix.image_flavor) }}" >> $GITHUB_ENV
echo "IMAGE_NAME=${{ format('{0}-{1}', matrix.base_name, matrix.image_flavor) }}" >> $GITHUB_ENV
fi
- name: Generate tags
Expand Down Expand Up @@ -122,6 +122,8 @@ jobs:
FEDORA_MAJOR_VERSION=${{ matrix.major_version }}
labels: ${{ steps.meta.outputs.labels }}
oci: false
extra-args: |
--target=${{ matrix.base_name }}
# Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR.
# https://github.com/macbre/push-to-ghcr/issues/12
Expand Down
29 changes: 28 additions & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG SOURCE_IMAGE="${SOURCE_IMAGE:-$BASE_IMAGE_NAME-$IMAGE_FLAVOR}"
ARG BASE_IMAGE="ghcr.io/ublue-os/${SOURCE_IMAGE}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-37}"

FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS bluefin

ARG IMAGE_NAME="${IMAGE_NAME}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
Expand Down Expand Up @@ -45,3 +45,30 @@ COPY --from=cgr.dev/chainguard/cosign:latest /usr/bin/cosign /usr/bin/cosign
RUN curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.17.0/kind-$(uname)-amd64"
RUN chmod +x ./kind
RUN mv ./kind /usr/bin/kind

FROM bluefin AS bluefin-dx

ARG IMAGE_NAME="${IMAGE_NAME}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"

# If you need to copy specific files for this -dx edition create
# a directory called "dx" in the project root, create an etc, in
# there and drop your files in. Uncomment the line below to enable
COPY dx/etc /etc

RUN wget https://copr.fedorainfracloud.org/coprs/ganto/lxc4/repo/fedora-"${FEDORA_MAJOR_VERSION}"/ganto-lxc4-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/ganto-lxc4-fedora-"${FEDORA_MAJOR_VERSION}".repo

RUN rpm-ostree install code
RUN rpm-ostree install lxd lxc
RUN rpm-ostree install iotop dbus-x11 podman-compose podman-docker podman-plugins podman-tui
RUN rpm-ostree install cascadia-code-fonts google-droid-sans-mono-fonts google-go-mono-fonts ibm-plex-mono-fonts mozilla-fira-mono-fonts
RUN rpm-ostree install qemu qemu-user-static qemu-user-binfmt virt-manager libvirt qemu qemu-user-static qemu-user-binfmt edk2-ovmf
RUN rpm-ostree install cockpit-bridge cockpit-system cockpit-networkmanager cockpit-selinux cockpit-storaged cockpit-podman cockpit-machines cockpit-pcp

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

RUN rm -rf /tmp/* /var/*
RUN ostree container commit
13 changes: 13 additions & 0 deletions dx/etc/yum.repos.d/hashicorp.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[hashicorp]
name=Hashicorp Stable - $basearch
baseurl=https://rpm.releases.hashicorp.com/fedora/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://rpm.releases.hashicorp.com/gpg

[hashicorp-test]
name=Hashicorp Test - $basearch
baseurl=https://rpm.releases.hashicorp.com/fedora/$releasever/$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://rpm.releases.hashicorp.com/gpg
6 changes: 6 additions & 0 deletions dx/etc/yum.repos.d/vscode.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=0
gpgkey=https://packages.microsoft.com/keys/microsoft.asc

0 comments on commit 98a4d23

Please sign in to comment.