Merge pull request 'Move to Fedora' (#1) from feature/fedora into main
Some checks failed
Build other containers / other-build (push) Has been cancelled
Build base containers / base-build (push) Failing after 1m0s

Reviewed-on: Maurice/devcontainers#1
This commit was merged in pull request #1.
This commit is contained in:
2025-10-28 07:48:34 +00:00
13 changed files with 45 additions and 76 deletions

View File

@@ -4,9 +4,7 @@ on:
branches: ["main"]
paths:
- "base.Containerfile"
- "web-base.Containerfile"
- "config/"
- "scripts/build-host-spawn.sh"
- ".gitea/workflows/base.yaml"
jobs:
@@ -32,14 +30,4 @@ jobs:
push: true
tags: git.plabble.org/maurice/devc-base:${{ github.ref_name }}
build-args: TAG=${{ github.ref_name }}
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
- name: Build and push Web Base container
uses: docker/build-push-action@v5
with:
context: .
file: ./web-base.Containerfile
push: true
tags: git.plabble.org/maurice/devc-web-base:${{ github.ref_name }}
build-args: TAG=${{ github.ref_name }}
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true

View File

@@ -3,7 +3,7 @@ on:
push:
branches: ["main"]
paths:
- "fullstack.Containerfile"
- "dotnet.Containerfile"
- "php.Containerfile"
- "rust.Containerfile"
- "scripts/install-roslyn.sh"
@@ -44,12 +44,12 @@ jobs:
build-args: TAG=${{ github.ref_name }}
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
- name: Build and push Fullstack container
- name: Build and push Dotnet container
uses: docker/build-push-action@v5
with:
context: .
file: ./fullstack.Containerfile
file: ./dotnet.Containerfile
push: true
tags: git.plabble.org/maurice/devc-fullstack:${{ github.ref_name }}
tags: git.plabble.org/maurice/devc-dotnet:${{ github.ref_name }}
build-args: TAG=${{ github.ref_name }}
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true

View File

@@ -1,24 +1,29 @@
FROM alpine:latest
FROM fedora:43
RUN apk update && apk add --no-cache \
git openssh helix bash bash-completion go curl \
helix-tree-sitter-vendor podman-compose wl-clipboard
# Install dependencies
RUN dnf update -y && \
dnf -y install procps ping bash-completion glibc-langpack-en \
host-spawn dbus-launch \
git unzip helix pnpm
# tree-sitter-yaml, tree-sitter-caddy
# Setup user
RUN useradd -ms /bin/bash user && \
usermod -aG wheel user && sed -i '/NOPASSWD/s/^#//g' /etc/sudoers && \
mkdir -p /run/user/1000 && chown user:user /run/user/1000
RUN adduser -D -u 1000 -s /bin/bash user
USER user
WORKDIR /home/user
# Compile host-spawn
COPY scripts/build-host-spawn.sh .
RUN chmod +x build-host-spawn.sh
RUN ./build-host-spawn.sh
# Setup some language servers from NPM
RUN pnpm setup && . /home/user/.bashrc && pnpm i -g deno bash-language-server vscode-langservers-extracted dockerfile-language-server-nodejs \
typescript typescript-language-server
# Copy configs
COPY --chown=user:user config/bashrc .bashrc
COPY --chown=user:user config/.config/ .config/
COPY config/bin /usr/local/bin
# Allow Podman host access
RUN ln -s /usr/local/bin/spawn /usr/local/bin/podman
RUN ln -s /usr/local/bin/host /usr/local/bin/podman
# Config files
COPY config/ /home/user/
RUN chown -R user:user /home/user
WORKDIR /home/user
VOLUME /home/user

View File

@@ -15,4 +15,4 @@ if [ ! -f "$containerfile" ]; then
exit 1
fi
podman build -t "devc-$1" -f $containerfile
podman build -t "git.plabble.org/maurice/devc-$1:test" -f $containerfile

4
config/bin/host Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
export DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/bus
host-spawn -cwd "${PWD/#$HOME/$HOST_HOME}" \
$([ "$(basename "$0")" != "host" ] && echo "$(basename "$0")") "$@"

9
dotnet.Containerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM git.plabble.org/maurice/devc-base:main
USER root
RUN dnf -y install dotnet-sdk-9.0
COPY scripts/install-roslyn.sh /tmp/install-roslyn.sh
RUN chmod +x /tmp/install-roslyn.sh && /tmp/install-roslyn.sh
USER user

View File

@@ -7,6 +7,7 @@ if [ -z "$1" ]; then
fi
name="devc-$1"
tag="main"
command="/bin/bash"
# When container is not running or arguments are provided,
@@ -29,7 +30,7 @@ if [ "$(podman container inspect "$name" -f {{.State.Running}} 2>&1)" != 'true'
-v /run/user/$UID/wayland-0:/tmp/xdg/wayland-0 \
-v $HOME/dev:/home/user/dev \
-v v-$name:/home/user:copy \
--rm -td git.plabble.org/maurice/$name:main
--rm -td git.plabble.org/maurice/$name:$tag
fi
podman exec --detach-keys "ctrl-@" -it "$name" ${command:-}

View File

@@ -1,10 +0,0 @@
FROM git.plabble.org/maurice/devc-web-base:main
RUN apk add --no-cache \
dotnet9-sdk
COPY scripts/install-roslyn.sh /tmp/install-roslyn.sh
RUN chmod +x /tmp/install-roslyn.sh && /tmp/install-roslyn.sh
USER user
RUN dotnet tool install --global dotnet-ef

View File

@@ -1,4 +1,3 @@
FROM git.plabble.org/maurice/devc-web-base:main
FROM git.plabble.org/maurice/devc-base:main
USER user
RUN /bin/bash -c "$(curl -fsSL https://php.new/install/linux/8.4)"

View File

@@ -1,6 +1,4 @@
FROM git.plabble.org/maurice/devc-base:main
RUN su -c "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" user
RUN su -c ". '/home/user/.cargo/env' && rustup component add rust-analyzer" user
USER user
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN . '/home/user/.cargo/env' && rustup component add rust-analyzer

View File

@@ -1,18 +0,0 @@
#!/bin/bash
mkdir /tmp/build
cd /tmp/build
git clone https://github.com/1player/host-spawn.git
cd host-spawn
chmod +x build.sh
./build.sh $(uname -m)
cd build
mv host-spawn* /usr/local/bin/host-spawn
rm -rf /tmp/build
cat << EOF > /usr/local/bin/spawn
#!/bin/bash
export DBUS_SESSION_BUS_ADDRESS='unix:path=/tmp/dbus.sock'
host-spawn -cwd "\${PWD/#\$HOME/\$HOST_HOME}" \
$([ "$(basename "\$0")" != "spawn" ] && echo "\$(basename "\$0")") "\$@"
EOF
chmod +x /usr/local/bin/spawn

View File

@@ -1,7 +0,0 @@
FROM git.plabble.org/maurice/devc-base:main
RUN apk add --no-cache \
deno pnpm
RUN su -c "pnpm setup && . /home/user/.bashrc && pnpm i -g bash-language-server vscode-langservers-extracted dockerfile-language-server-nodejs \
typescript typescript-language-server" user