From d73e2ad3198d160c78d212414f1909d3af5f5288 Mon Sep 17 00:00:00 2001 From: thediveo Date: Sun, 9 Nov 2025 20:31:10 +0100 Subject: [PATCH 1/5] feat/bpftool: support alpine Signed-off-by: thediveo --- src/bpftool/devcontainer-feature.json | 2 +- src/bpftool/install.sh | 32 +++++++++++++++++++++++---- test/bpftool/alpine.sh | 4 ++++ test/bpftool/scenarios.json | 6 +++++ test/bpftool/test.sh | 2 +- 5 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 test/bpftool/alpine.sh diff --git a/src/bpftool/devcontainer-feature.json b/src/bpftool/devcontainer-feature.json index 170c463..efac100 100644 --- a/src/bpftool/devcontainer-feature.json +++ b/src/bpftool/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "bpftool", "id": "bpftool", - "version": "0.0.2", + "version": "0.0.3", "description": "Installs bpftool from upstream https://github.com/libbpf/bpftool binary releases.", "options": { "version": { diff --git a/src/bpftool/install.sh b/src/bpftool/install.sh index 19f915b..14d2327 100755 --- a/src/bpftool/install.sh +++ b/src/bpftool/install.sh @@ -12,6 +12,10 @@ set -e BPFTOOL_VERSION="${VERSION:-"latest"}" +REPOSLUG="libbpf/bpftool" +QUERYLATEST_URL="https://api.github.com/repos/${REPOSLUG}/releases/latest" +RELEASE_URL="https://github.com/${REPOSLUG}/releases/download/" + echo "installing feature bpftool..." if [ "$(id -u)" -ne 0 ]; then @@ -25,6 +29,8 @@ fi MAJOR_VERSION_ID=$(echo ${VERSION_ID} | cut -d . -f 1) if [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then ADJUSTED_ID="debian" +elif [ "${ID}" = "alpine" ]; then + ADJUSTED_ID="alpine" elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then ADJUSTED_ID="rhel" if [[ "${ID}" = "rhel" ]] || [[ "${ID}" = *"alma"* ]] || [[ "${ID}" = *"rocky"* ]]; then @@ -49,6 +55,9 @@ fi if type apt-get > /dev/null 2>&1; then PKG_MGR_CMD=apt-get INSTALL_CMD="${PKG_MGR_CMD} -y install --no-install-recommends" +elif type apk > /dev/null 2>&1; then + PKG_MGR_CMD=apk + INSTALL_CMD="${PKG_MGR_CMD} add --no-interactive" elif type microdnf > /dev/null 2>&1; then PKG_MGR_CMD=microdnf INSTALL_CMD="${PKG_MGR_CMD} ${INSTALL_CMD_ADDL_REPOS} -y install --refresh --best --nodocs --noplugins --setopt=install_weak_deps=0" @@ -63,6 +72,9 @@ fi # Clean up clean_up() { case ${ADJUSTED_ID} in + alpine) + rm -rf /var/cache/apk/* + ;; debian) rm -rf /var/lib/apt/lists/* ;; @@ -77,6 +89,12 @@ clean_up pkg_mgr_update() { case $ADJUSTED_ID in + alpine) + if [ "$(find /var/cache/apk/* | wc -l)" = "0" ]; then + echo "Running apk update..." + ${PKG_MGR_CMD} update + fi + ;; debian) if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then echo "Running apt-get update..." @@ -108,6 +126,9 @@ pkg_mgr_update() { # Checks if packages are installed and installs them if not check_packages() { case ${ADJUSTED_ID} in + alpine) + ${INSTALL_CMD} "$@" + ;; debian) if ! dpkg -s "$@" > /dev/null 2>&1; then pkg_mgr_update @@ -137,13 +158,16 @@ fi if [ "$BPFTOOL_VERSION" = "latest" ]; then # get latest release - BPFTOOL_VERSION=$(curl -s https://api.github.com/repos/libbpf/bpftool/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + BPFTOOL_VERSION=$(curl -s ${QUERYLATEST_URL} | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') fi -echo $BPFTOOL_VERSION -echo $ARCH +echo "installing bpftool version: ${BPFTOOL_VERSION}" +echo "for architecture ${ARCH}" + +URL="${RELEASE_URL}${BPFTOOL_VERSION}/bpftool-${BPFTOOL_VERSION}-${ARCH}.tar.gz" +echo "from: ${URL}" -curl -sSL -o /tmp/bpftool.tar.gz "https://github.com/libbpf/bpftool/releases/download/${BPFTOOL_VERSION}/bpftool-${BPFTOOL_VERSION}-${ARCH}.tar.gz" +curl -sSL -o /tmp/bpftool.tar.gz "${URL}" ls -l /tmp/bpftool.tar.gz tar xzof /tmp/bpftool.tar.gz -C /usr/local/bin/ bpftool chmod 0755 /usr/local/bin/bpftool diff --git a/test/bpftool/alpine.sh b/test/bpftool/alpine.sh new file mode 100644 index 0000000..d4e56d7 --- /dev/null +++ b/test/bpftool/alpine.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e + +. ./test.sh diff --git a/test/bpftool/scenarios.json b/test/bpftool/scenarios.json index 4a7112e..af75017 100644 --- a/test/bpftool/scenarios.json +++ b/test/bpftool/scenarios.json @@ -13,6 +13,12 @@ "bpftool": {} } }, + "alpine": { + "image": "mcr.microsoft.com/devcontainers/base:alpine", + "features": { + "bpftool": {} + } + }, "debian": { "image": "mcr.microsoft.com/devcontainers/base:debian-12", "features": { diff --git a/test/bpftool/test.sh b/test/bpftool/test.sh index 632caf4..2c8d541 100755 --- a/test/bpftool/test.sh +++ b/test/bpftool/test.sh @@ -3,6 +3,6 @@ set -e source dev-container-features-test-lib -check "bpftool" bash -c "bpftool" +check "bpftool" bash -c "bpftool 2>&1 | grep 'Usage: bpftool \[OPTIONS\]'" reportResults From fc9cbfaac22c9f6d683523b5190dca0bce0080a0 Mon Sep 17 00:00:00 2001 From: thediveo Date: Sun, 9 Nov 2025 20:40:50 +0100 Subject: [PATCH 2/5] feat/grafanactl: support alpine Signed-off-by: thediveo --- src/grafanactl/devcontainer-feature.json | 2 +- src/grafanactl/install.sh | 32 ++++++++++++++++++++---- test/grafanactl/alpine.sh | 4 +++ test/grafanactl/scenarios.json | 6 +++++ 4 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 test/grafanactl/alpine.sh diff --git a/src/grafanactl/devcontainer-feature.json b/src/grafanactl/devcontainer-feature.json index a8b3a25..0628f0e 100644 --- a/src/grafanactl/devcontainer-feature.json +++ b/src/grafanactl/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "grafanactl", "id": "grafanactl", - "version": "0.0.1", + "version": "0.0.2", "description": "Installs grafanactl from upstream https://github.com/grafana/grafanactl binary releases.", "options": { "version": { diff --git a/src/grafanactl/install.sh b/src/grafanactl/install.sh index 850aa9e..4b7b1c7 100755 --- a/src/grafanactl/install.sh +++ b/src/grafanactl/install.sh @@ -12,6 +12,10 @@ set -e GRAFANACTL_VERSION="${VERSION:-"latest"}" +REPOSLUG="grafana/grafanactl" +QUERYLATEST_URL="https://api.github.com/repos/${REPOSLUG}/releases/latest" +RELEASE_URL="https://github.com/${REPOSLUG}/releases/download/" + echo "installing feature grafanactl..." if [ "$(id -u)" -ne 0 ]; then @@ -25,6 +29,8 @@ fi MAJOR_VERSION_ID=$(echo ${VERSION_ID} | cut -d . -f 1) if [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then ADJUSTED_ID="debian" +elif [ "${ID}" = "alpine" ]; then + ADJUSTED_ID="alpine" elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then ADJUSTED_ID="rhel" if [[ "${ID}" = "rhel" ]] || [[ "${ID}" = *"alma"* ]] || [[ "${ID}" = *"rocky"* ]]; then @@ -49,6 +55,9 @@ fi if type apt-get > /dev/null 2>&1; then PKG_MGR_CMD=apt-get INSTALL_CMD="${PKG_MGR_CMD} -y install --no-install-recommends" +elif type apk > /dev/null 2>&1; then + PKG_MGR_CMD=apk + INSTALL_CMD="${PKG_MGR_CMD} add --no-interactive" elif type microdnf > /dev/null 2>&1; then PKG_MGR_CMD=microdnf INSTALL_CMD="${PKG_MGR_CMD} ${INSTALL_CMD_ADDL_REPOS} -y install --refresh --best --nodocs --noplugins --setopt=install_weak_deps=0" @@ -63,6 +72,9 @@ fi # Clean up clean_up() { case ${ADJUSTED_ID} in + alpine) + rm -rf /var/cache/apk/* + ;; debian) rm -rf /var/lib/apt/lists/* ;; @@ -77,6 +89,12 @@ clean_up pkg_mgr_update() { case $ADJUSTED_ID in + alpine) + if [ "$(find /var/cache/apk/* | wc -l)" = "0" ]; then + echo "Running apk update..." + ${PKG_MGR_CMD} update + fi + ;; debian) if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then echo "Running apt-get update..." @@ -108,6 +126,9 @@ pkg_mgr_update() { # Checks if packages are installed and installs them if not check_packages() { case ${ADJUSTED_ID} in + alpine) + ${INSTALL_CMD} "$@" + ;; debian) if ! dpkg -s "$@" > /dev/null 2>&1; then pkg_mgr_update @@ -137,15 +158,16 @@ fi if [ "$GRAFANACTL_VERSION" = "latest" ]; then # get latest release - GRAFANACTL_VERSION=$(curl -s https://api.github.com/repos/grafana/grafanactl/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + GRAFANACTL_VERSION=$(curl -s ${QUERYLATEST_URL} | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') fi -echo version: $GRAFANACTL_VERSION -echo for arch: $ARCH +echo "installing grafanactl version: ${GRAFANACTL_VERSION}" +echo "for architecture: ${ARCH}" -echo "https://github.com/grafana/grafanactl/releases/download/${GRAFANACTL_VERSION}/grafanactl_Linux_${ARCH}.tar.gz" +URL="${RELEASE_URL}${GRAFANACTL_VERSION}/grafanactl_Linux_${ARCH}.tar.gz" +echo "from: ${URL}" -curl -sSL -o /tmp/grafanactl.tar.gz "https://github.com/grafana/grafanactl/releases/download/${GRAFANACTL_VERSION}/grafanactl_Linux_${ARCH}.tar.gz" +curl -sSL -o /tmp/grafanactl.tar.gz "${URL}" ls -lH /tmp/grafanactl.tar.gz tar xzof /tmp/grafanactl.tar.gz -C /usr/local/bin/ grafanactl chmod 0755 /usr/local/bin/grafanactl diff --git a/test/grafanactl/alpine.sh b/test/grafanactl/alpine.sh new file mode 100644 index 0000000..d4e56d7 --- /dev/null +++ b/test/grafanactl/alpine.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e + +. ./test.sh diff --git a/test/grafanactl/scenarios.json b/test/grafanactl/scenarios.json index 76a1029..999923f 100644 --- a/test/grafanactl/scenarios.json +++ b/test/grafanactl/scenarios.json @@ -13,6 +13,12 @@ "grafanactl": {} } }, + "alpine": { + "image": "mcr.microsoft.com/devcontainers/base:alpine", + "features": { + "grafanactl": {} + } + }, "debian": { "image": "mcr.microsoft.com/devcontainers/base:debian-12", "features": { From 8cc1f30976f2dcecb76209a01bd1c7d4e401094f Mon Sep 17 00:00:00 2001 From: thediveo Date: Sun, 9 Nov 2025 22:21:49 +0100 Subject: [PATCH 3/5] feat: lazygit from upstream, incl. Alpine support Signed-off-by: thediveo --- src/lazygit/NOTES.md | 12 ++ src/lazygit/README.md | 36 ++++++ src/lazygit/devcontainer-feature.json | 13 ++ src/lazygit/install.sh | 177 ++++++++++++++++++++++++++ test/lazygit/almalinux.sh | 4 + test/lazygit/alpine.sh | 4 + test/lazygit/debian.sh | 4 + test/lazygit/fedora.sh | 4 + test/lazygit/scenarios.json | 34 +++++ test/lazygit/test.sh | 8 ++ test/lazygit/v0.55.1.sh | 8 ++ 11 files changed, 304 insertions(+) create mode 100644 src/lazygit/NOTES.md create mode 100644 src/lazygit/README.md create mode 100644 src/lazygit/devcontainer-feature.json create mode 100755 src/lazygit/install.sh create mode 100644 test/lazygit/almalinux.sh create mode 100644 test/lazygit/alpine.sh create mode 100644 test/lazygit/debian.sh create mode 100644 test/lazygit/fedora.sh create mode 100644 test/lazygit/scenarios.json create mode 100755 test/lazygit/test.sh create mode 100644 test/lazygit/v0.55.1.sh diff --git a/src/lazygit/NOTES.md b/src/lazygit/NOTES.md new file mode 100644 index 0000000..23d2d21 --- /dev/null +++ b/src/lazygit/NOTES.md @@ -0,0 +1,12 @@ +## OS Support + +Tested with: +- [mcr.microsoft.com/devcontainers/base:alpine](mcr.microsoft.com/devcontainers/base:alpine), +- [ghcr.io/almalinux/almalinux](https://ghcr.io/almalinux/almalinux), +- [mcr.microsoft.com/devcontainers/base:debian](https://mcr.microsoft.com/en-us/artifact/mar/devcontainers/base/about#about:_debian), +- [fedora](https://hub.docker.com/_/fedora), +- [mcr.microsoft.com/devcontainers/base:ubuntu](https://mcr.microsoft.com/en-us/artifact/mar/devcontainers/base/about#about:_ubuntu). + +## Acknowledgement + +[@bpftool](https://github.com/libbpf/bpftool) diff --git a/src/lazygit/README.md b/src/lazygit/README.md new file mode 100644 index 0000000..f7ea143 --- /dev/null +++ b/src/lazygit/README.md @@ -0,0 +1,36 @@ + +# lazygit (lazygit) + +Installs lazygit from upstream https://github.com/jesseduffield/lazygit binary releases. + +## Example Usage + +```json +"features": { + "ghcr.io/thediveo/devcontainer-features/lazygit:0": {} +} +``` + +## Options + +| Options Id | Description | Type | Default Value | +|-----|-----|-----|-----| +| version | version of lazygit to install from upstream | string | latest | + +## OS Support + +Tested with: +- [mcr.microsoft.com/devcontainers/base:alpine](mcr.microsoft.com/devcontainers/base:alpine), +- [ghcr.io/almalinux/almalinux](https://ghcr.io/almalinux/almalinux), +- [mcr.microsoft.com/devcontainers/base:debian](https://mcr.microsoft.com/en-us/artifact/mar/devcontainers/base/about#about:_debian), +- [fedora](https://hub.docker.com/_/fedora), +- [mcr.microsoft.com/devcontainers/base:ubuntu](https://mcr.microsoft.com/en-us/artifact/mar/devcontainers/base/about#about:_ubuntu). + +## Acknowledgement + +[@bpftool](https://github.com/libbpf/bpftool) + + +--- + +_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/thediveo/devcontainer-features/blob/main/src/lazygit/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ diff --git a/src/lazygit/devcontainer-feature.json b/src/lazygit/devcontainer-feature.json new file mode 100644 index 0000000..2cb1ca3 --- /dev/null +++ b/src/lazygit/devcontainer-feature.json @@ -0,0 +1,13 @@ +{ + "name": "lazygit", + "id": "lazygit", + "version": "0.0.1", + "description": "Installs lazygit from upstream https://github.com/jesseduffield/lazygit binary releases.", + "options": { + "version": { + "type": "string", + "default": "latest", + "description": "version of lazygit to install from upstream" + } + } +} \ No newline at end of file diff --git a/src/lazygit/install.sh b/src/lazygit/install.sh new file mode 100755 index 0000000..8a5a504 --- /dev/null +++ b/src/lazygit/install.sh @@ -0,0 +1,177 @@ +#!/usr/bin/env bash + +# Distribution and package manager detection are licensed by Microsoft +# Corporation under the MIT License, please refer to: +# https://github.com/devcontainers/features/blob/main/src/go/install.sh: +# +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the +# MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license +# information + +set -e + +LAZYGIT_VERSION="${VERSION:-"latest"}" + +REPOSLUG="jesseduffield/lazygit" +QUERYLATEST_URL="https://api.github.com/repos/${REPOSLUG}/releases/latest" +RELEASE_URL="https://github.com/${REPOSLUG}/releases/download/" + +echo "installing feature lazygit..." + +if [ "$(id -u)" -ne 0 ]; then + echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' + exit 1 +fi + +# Bring in ID, ID_LIKE, VERSION_ID, VERSION_CODENAME +. /etc/os-release +# Get an adjusted ID independent of distro variants +MAJOR_VERSION_ID=$(echo ${VERSION_ID} | cut -d . -f 1) +if [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then + ADJUSTED_ID="debian" +elif [ "${ID}" = "alpine" ]; then + ADJUSTED_ID="alpine" +elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then + ADJUSTED_ID="rhel" + if [[ "${ID}" = "rhel" ]] || [[ "${ID}" = *"alma"* ]] || [[ "${ID}" = *"rocky"* ]]; then + VERSION_CODENAME="rhel${MAJOR_VERSION_ID}" + else + VERSION_CODENAME="${ID}${MAJOR_VERSION_ID}" + fi +else + echo "Linux distro ${ID} not supported." + exit 1 +fi + +if [ "${ADJUSTED_ID}" = "rhel" ] && [ "${VERSION_CODENAME-}" = "centos7" ]; then + # As of 1 July 2024, mirrorlist.centos.org no longer exists. + # Update the repo files to reference vault.centos.org. + sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo +fi + +# Setup INSTALL_CMD & PKG_MGR_CMD +if type apt-get > /dev/null 2>&1; then + PKG_MGR_CMD=apt-get + INSTALL_CMD="${PKG_MGR_CMD} -y install --no-install-recommends" +elif type apk > /dev/null 2>&1; then + PKG_MGR_CMD=apk + INSTALL_CMD="${PKG_MGR_CMD} add --no-interactive" +elif type microdnf > /dev/null 2>&1; then + PKG_MGR_CMD=microdnf + INSTALL_CMD="${PKG_MGR_CMD} ${INSTALL_CMD_ADDL_REPOS} -y install --refresh --best --nodocs --noplugins --setopt=install_weak_deps=0" +elif type dnf > /dev/null 2>&1; then + PKG_MGR_CMD=dnf + INSTALL_CMD="${PKG_MGR_CMD} ${INSTALL_CMD_ADDL_REPOS} -y install --refresh --best --nodocs --noplugins --setopt=install_weak_deps=0" +else + PKG_MGR_CMD=yum + INSTALL_CMD="${PKG_MGR_CMD} ${INSTALL_CMD_ADDL_REPOS} -y install --noplugins --setopt=install_weak_deps=0" +fi + +# Clean up +clean_up() { + case ${ADJUSTED_ID} in + alpine) + rm -rf /var/cache/apk/* + ;; + debian) + rm -rf /var/lib/apt/lists/* + ;; + rhel) + rm -rf /var/cache/dnf/* /var/cache/yum/* + rm -rf /tmp/yum.log + rm -rf ${GPG_INSTALL_PATH} + ;; + esac +} +clean_up + +pkg_mgr_update() { + case $ADJUSTED_ID in + alpine) + if [ "$(find /var/cache/apk/* | wc -l)" = "0" ]; then + echo "Running apk update..." + ${PKG_MGR_CMD} update + fi + ;; + debian) + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + ${PKG_MGR_CMD} update -y + fi + ;; + rhel) + if [ ${PKG_MGR_CMD} = "microdnf" ]; then + if [ "$(ls /var/cache/yum/* 2>/dev/null | wc -l)" = 0 ]; then + echo "Running ${PKG_MGR_CMD} makecache ..." + ${PKG_MGR_CMD} makecache + fi + else + if [ "$(ls /var/cache/${PKG_MGR_CMD}/* 2>/dev/null | wc -l)" = 0 ]; then + echo "Running ${PKG_MGR_CMD} check-update ..." + set +e + ${PKG_MGR_CMD} check-update + rc=$? + if [ $rc != 0 ] && [ $rc != 100 ]; then + exit 1 + fi + set -e + fi + fi + ;; + esac +} + +# Checks if packages are installed and installs them if not +check_packages() { + case ${ADJUSTED_ID} in + alpine) + ${INSTALL_CMD} "$@" + ;; + debian) + if ! dpkg -s "$@" > /dev/null 2>&1; then + pkg_mgr_update + ${INSTALL_CMD} "$@" + fi + ;; + rhel) + if ! rpm -q "$@" > /dev/null 2>&1; then + pkg_mgr_update + ${INSTALL_CMD} "$@" + fi + ;; + esac +} + +case $(uname -m) in + x86_64) ARCH="x86_64";; + aarch64 | armv8*) ARCH="arm64";; + *) echo "Unsupported architecture: $(uname -m)"; exit 1;; +esac + +export DEBIAN_FRONTEND=noninteractive + +if ! type curl > /dev/null 2>&1; then + check_packages curl +fi + +if [ "$LAZYGIT_VERSION" = "latest" ]; then + # get latest release + LAZYGIT_VERSION=$(curl -s ${QUERYLATEST_URL} | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') +fi + +echo "installing lazygit version: ${LAZYGIT_VERSION}" +echo "for architecture ${ARCH}" + +URL="${RELEASE_URL}${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION#v}_linux_${ARCH}.tar.gz" +echo "from: ${URL}" + +curl -sSL -o /tmp/lazygit.tar.gz "${URL}" +ls -l /tmp/lazygit.tar.gz +tar xzof /tmp/lazygit.tar.gz -C /usr/local/bin/ lazygit +rm /tmp/lazygit.tar.gz + +clean_up + +echo "Done!" diff --git a/test/lazygit/almalinux.sh b/test/lazygit/almalinux.sh new file mode 100644 index 0000000..d4e56d7 --- /dev/null +++ b/test/lazygit/almalinux.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e + +. ./test.sh diff --git a/test/lazygit/alpine.sh b/test/lazygit/alpine.sh new file mode 100644 index 0000000..d4e56d7 --- /dev/null +++ b/test/lazygit/alpine.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e + +. ./test.sh diff --git a/test/lazygit/debian.sh b/test/lazygit/debian.sh new file mode 100644 index 0000000..d4e56d7 --- /dev/null +++ b/test/lazygit/debian.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e + +. ./test.sh diff --git a/test/lazygit/fedora.sh b/test/lazygit/fedora.sh new file mode 100644 index 0000000..d4e56d7 --- /dev/null +++ b/test/lazygit/fedora.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e + +. ./test.sh diff --git a/test/lazygit/scenarios.json b/test/lazygit/scenarios.json new file mode 100644 index 0000000..8feb134 --- /dev/null +++ b/test/lazygit/scenarios.json @@ -0,0 +1,34 @@ +{ + "v0.55.1": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04", + "features": { + "lazygit": { + "version": "v0.55.1" + } + } + }, + "almalinux": { + "image": "ghcr.io/almalinux/almalinux:9", + "features": { + "lazygit": {} + } + }, + "alpine": { + "image": "mcr.microsoft.com/devcontainers/base:alpine", + "features": { + "lazygit": {} + } + }, + "debian": { + "image": "mcr.microsoft.com/devcontainers/base:debian-12", + "features": { + "lazygit": {} + } + }, + "fedora": { + "image": "fedora", + "features": { + "lazygit": {} + } + } +} \ No newline at end of file diff --git a/test/lazygit/test.sh b/test/lazygit/test.sh new file mode 100755 index 0000000..b2eb2b4 --- /dev/null +++ b/test/lazygit/test.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e + +source dev-container-features-test-lib + +check "lazygit" bash -c "lazygit --version | grep -E 'version=[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+,'" + +reportResults diff --git a/test/lazygit/v0.55.1.sh b/test/lazygit/v0.55.1.sh new file mode 100644 index 0000000..69bbf6b --- /dev/null +++ b/test/lazygit/v0.55.1.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e + +source dev-container-features-test-lib + +check "lazygit" bash -c "lazygit --version | grep 'version=0.55.1,'" + +reportResults From 0d331d8951f60fd37fdbd4f7145adc8fc89d2b35 Mon Sep 17 00:00:00 2001 From: thediveo Date: Sun, 9 Nov 2025 22:22:06 +0100 Subject: [PATCH 4/5] chore: docs Signed-off-by: thediveo --- README.md | 20 ++++++++++++++++++++ src/bpftool/NOTES.md | 1 + src/bpftool/README.md | 1 + 3 files changed, 22 insertions(+) diff --git a/README.md b/README.md index 59ac118..62d237f 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,23 @@ unfortunately only to the limitation of different distribution support in Dev Containers features we rely on. In case of Go tools, this unfortunately leaves out Alpine, because [Microsoft's Go Dev Container feature does not support Alpine](https://github.com/devcontainers/features/blob/091886b3568dad70f835cc428dad1fdf7bc6a9b3/src/go/install.sh#L32-L44). +Same unfortunate situation Microsoft's node Dev Container feature that also +doesn't support Alpine. + +| Feature | Alpine | Alma | Debian | Fedora | Ubuntu | +| ----------------- | ------ | ---- | ------ | ------ | ------ | +| bpftool | ✅ | ✅ | ✅ | ✅ | ✅ | +| cni-plugins | | ✅ | ✅ | ✅ | ✅ | +| docsify | | ✅ | ✅ | ✅ | ✅ | +| go-ebpf | | ✅ | ✅ | ✅ | ✅ | +| go-mod-upgrade | | ✅ | ✅ | ✅ | ✅ | +| gocover | | ✅ | ✅ | ✅ | ✅ | +| goreportcard | | ✅ | ✅ | ✅ | ✅ | +| grafanactl | ✅ | ✅ | ✅ | ✅ | ✅ | +| lazygit | ✅ | ✅ | ✅ | ✅ | ✅ | +| local-pkgsite | | ✅ | ✅ | ✅ | ✅ | +| pin-github-action | | ✅ | ✅ | ✅ | ✅ | +| wal-wahl | | ✅ | ✅ | ✅ | ✅ | - [bpftool](src/bpftool/README.md) – installs `bpftool` directly from upstream https://github.com/libbpf/bpftool binary releases, especially avoiding the @@ -40,6 +57,9 @@ Alpine](https://github.com/devcontainers/features/blob/091886b3568dad70f835cc428 creates a Go report and a `README.md` badge on the code quality of a repository. +- [lazygit](src/lazygit/README.md) – installs `lazygit` directly from upstream + https://github.com/jesseduffield/lazygit binary releases. + - [local-pkgsite](src/local-pkgsite/README.md) – a local Go pkgsite serving the module documentation, with automatic project reload and browser refresh. diff --git a/src/bpftool/NOTES.md b/src/bpftool/NOTES.md index 6bb9fb4..23d2d21 100644 --- a/src/bpftool/NOTES.md +++ b/src/bpftool/NOTES.md @@ -1,6 +1,7 @@ ## OS Support Tested with: +- [mcr.microsoft.com/devcontainers/base:alpine](mcr.microsoft.com/devcontainers/base:alpine), - [ghcr.io/almalinux/almalinux](https://ghcr.io/almalinux/almalinux), - [mcr.microsoft.com/devcontainers/base:debian](https://mcr.microsoft.com/en-us/artifact/mar/devcontainers/base/about#about:_debian), - [fedora](https://hub.docker.com/_/fedora), diff --git a/src/bpftool/README.md b/src/bpftool/README.md index 884e3a4..1ce0d90 100644 --- a/src/bpftool/README.md +++ b/src/bpftool/README.md @@ -20,6 +20,7 @@ Installs bpftool from upstream https://github.com/libbpf/bpftool binary releases ## OS Support Tested with: +- [mcr.microsoft.com/devcontainers/base:alpine](mcr.microsoft.com/devcontainers/base:alpine), - [ghcr.io/almalinux/almalinux](https://ghcr.io/almalinux/almalinux), - [mcr.microsoft.com/devcontainers/base:debian](https://mcr.microsoft.com/en-us/artifact/mar/devcontainers/base/about#about:_debian), - [fedora](https://hub.docker.com/_/fedora), From 0289e30c0ec4948b31a352ae82ed5836329c2c1d Mon Sep 17 00:00:00 2001 From: thediveo Date: Sun, 9 Nov 2025 22:24:03 +0100 Subject: [PATCH 5/5] chore: docs/test matrix Signed-off-by: thediveo --- .github/workflows/test.yaml | 1 + README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3ba922e..f2c54c7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -22,6 +22,7 @@ jobs: - go-ebpf - go-mod-upgrade - goreportcard + - lazygit - local-pkgsite - nerdctl - pin-github-action diff --git a/README.md b/README.md index 62d237f..01bcc0c 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ doesn't support Alpine. | grafanactl | ✅ | ✅ | ✅ | ✅ | ✅ | | lazygit | ✅ | ✅ | ✅ | ✅ | ✅ | | local-pkgsite | | ✅ | ✅ | ✅ | ✅ | +| nerdctl | | ✅ | ✅ | ✅ | ✅ | | pin-github-action | | ✅ | ✅ | ✅ | ✅ | | wal-wahl | | ✅ | ✅ | ✅ | ✅ |