Compare commits

..

1 Commits

Author SHA1 Message Date
b66fa4bcab revert e05616b660
revert Merge pull request 'Move to Fedora' (#1) from feature/fedora into main

Reviewed-on: Maurice/devcontainers#1
2025-10-28 07:54:34 +00:00
13 changed files with 76 additions and 45 deletions

View File

@@ -4,7 +4,9 @@ on:
branches: ["main"] branches: ["main"]
paths: paths:
- "base.Containerfile" - "base.Containerfile"
- "web-base.Containerfile"
- "config/" - "config/"
- "scripts/build-host-spawn.sh"
- ".gitea/workflows/base.yaml" - ".gitea/workflows/base.yaml"
jobs: jobs:
@@ -30,4 +32,14 @@ jobs:
push: true push: true
tags: git.plabble.org/maurice/devc-base:${{ github.ref_name }} tags: git.plabble.org/maurice/devc-base:${{ github.ref_name }}
build-args: TAG=${{ 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
- 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

View File

@@ -3,7 +3,7 @@ on:
push: push:
branches: ["main"] branches: ["main"]
paths: paths:
- "dotnet.Containerfile" - "fullstack.Containerfile"
- "php.Containerfile" - "php.Containerfile"
- "rust.Containerfile" - "rust.Containerfile"
- "scripts/install-roslyn.sh" - "scripts/install-roslyn.sh"
@@ -44,12 +44,12 @@ jobs:
build-args: TAG=${{ 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
- name: Build and push Dotnet container - name: Build and push Fullstack container
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
file: ./dotnet.Containerfile file: ./fullstack.Containerfile
push: true push: true
tags: git.plabble.org/maurice/devc-dotnet:${{ github.ref_name }} tags: git.plabble.org/maurice/devc-fullstack:${{ github.ref_name }}
build-args: TAG=${{ 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

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

View File

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

View File

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

View File

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

10
fullstack.Containerfile Normal file
View File

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

View File

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

View File

@@ -0,0 +1,18 @@
#!/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

7
web-base.Containerfile Normal file
View File

@@ -0,0 +1,7 @@
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