Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e05616b660 | |||
|
|
9ef278fc7c |
@@ -4,9 +4,7 @@ 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:
|
||||||
@@ -32,14 +30,4 @@ 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
|
|
||||||
@@ -3,7 +3,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
paths:
|
paths:
|
||||||
- "fullstack.Containerfile"
|
- "dotnet.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 Fullstack container
|
- name: Build and push Dotnet container
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./fullstack.Containerfile
|
file: ./dotnet.Containerfile
|
||||||
push: true
|
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 }}
|
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
|
||||||
|
|||||||
@@ -1,24 +1,29 @@
|
|||||||
FROM alpine:latest
|
FROM fedora:43
|
||||||
|
|
||||||
RUN apk update && apk add --no-cache \
|
# Install dependencies
|
||||||
git openssh helix bash bash-completion go curl \
|
RUN dnf update -y && \
|
||||||
helix-tree-sitter-vendor podman-compose wl-clipboard
|
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
|
# Setup some language servers from NPM
|
||||||
COPY scripts/build-host-spawn.sh .
|
RUN pnpm setup && . /home/user/.bashrc && pnpm i -g deno bash-language-server vscode-langservers-extracted dockerfile-language-server-nodejs \
|
||||||
RUN chmod +x build-host-spawn.sh
|
typescript typescript-language-server
|
||||||
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/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
|
VOLUME /home/user
|
||||||
2
build.sh
2
build.sh
@@ -15,4 +15,4 @@ if [ ! -f "$containerfile" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
4
config/bin/host
Normal 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
9
dotnet.Containerfile
Normal 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
|
||||||
3
enter.sh
3
enter.sh
@@ -7,6 +7,7 @@ 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,
|
||||||
@@ -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 /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:main
|
--rm -td git.plabble.org/maurice/$name:$tag
|
||||||
fi
|
fi
|
||||||
|
|
||||||
podman exec --detach-keys "ctrl-@" -it "$name" ${command:-}
|
podman exec --detach-keys "ctrl-@" -it "$name" ${command:-}
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -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)"
|
RUN /bin/bash -c "$(curl -fsSL https://php.new/install/linux/8.4)"
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
FROM git.plabble.org/maurice/devc-base:main
|
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 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
RUN su -c ". '/home/user/.cargo/env' && rustup component add rust-analyzer" user
|
RUN . '/home/user/.cargo/env' && rustup component add rust-analyzer
|
||||||
|
|
||||||
USER user
|
|
||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user