forked from Job79/devcontainer
This commit is contained in:
48
.gitea/workflows/other.yaml
Normal file
48
.gitea/workflows/other.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Build optional dev containers
|
||||
on:
|
||||
workflow_dispatch: # This makes the workflow manually triggered
|
||||
|
||||
jobs:
|
||||
fedora-build:
|
||||
runs-on: job-latest
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.plabble.org
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push Rider container
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./containers/rider
|
||||
file: ./containers/rider/Containerfile
|
||||
push: true
|
||||
tags: git.plabble.org/maurice/rider:${{ 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 Android Studio container
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./containers/android
|
||||
file: ./containers/android/Containerfile
|
||||
push: true
|
||||
tags: git.plabble.org/maurice/android:${{ 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 Flutter container
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./containers/flutter
|
||||
file: ./containers/flutter/Containerfile
|
||||
push: true
|
||||
tags: git.plabble.org/maurice/flutter:${{ github.ref_name }}
|
||||
build-args: TAG=${{ github.ref_name }}
|
||||
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
||||
18
containers/android/Containerfile
Normal file
18
containers/android/Containerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM git.plabble.org/maurice/dotnet:main
|
||||
ARG studio_version="2025.1.4.8"
|
||||
ARG download_uri="https://redirector.gvt1.com/edgedl/android/studio/ide-zips/${studio_version}/android-studio-${studio_version}-linux.tar.gz"
|
||||
|
||||
USER root
|
||||
RUN dnf -y install libXext libXrender libXtst libX11 freetype freetype-devel mesa-libGLU
|
||||
USER user
|
||||
|
||||
RUN curl -Lo /tmp/studio.tar.gz "${download_uri}" && \
|
||||
mkdir /home/user/AndroidStudio && \
|
||||
mkdir /home/user/Android && \
|
||||
tar -zxf /tmp/studio.tar.gz -C /home/user/AndroidStudio && \
|
||||
rm /tmp/studio.tar.gz && \
|
||||
mv /home/user/AndroidStudio/android-studio*/* /home/user/AndroidStudio
|
||||
|
||||
RUN echo 'alias studio="$HOME/AndroidStudio/bin/studio"' >> /home/user/.bashrc
|
||||
RUN echo 'export ANDROID_HOME="$HOME/Android/Sdk"' >> /home/user/.bashrc
|
||||
RUN echo 'export PATH="$ANDROID_HOME/platform-tools:$PATH"' >> /home/user/.bashrc
|
||||
1
containers/android/env
Normal file
1
containers/android/env
Normal file
@@ -0,0 +1 @@
|
||||
DEVC_COMMAND=/home/user/AndroidStudio/bin/studio
|
||||
@@ -5,7 +5,7 @@ RUN dnf update -y && \
|
||||
dnf copr enable -y atim/lazygit && \
|
||||
dnf -y install procps ping bash-completion glibc-langpack-en \
|
||||
host-spawn dbus-launch \
|
||||
git pnpm helix
|
||||
git pnpm helix zip
|
||||
|
||||
# === setup user ===
|
||||
RUN useradd -ms /bin/bash user && \
|
||||
|
||||
11
containers/flutter/Containerfile
Normal file
11
containers/flutter/Containerfile
Normal file
@@ -0,0 +1,11 @@
|
||||
FROM git.plabble.org/maurice/android:main
|
||||
ARG flutter_version="3.35.7-stable"
|
||||
ARG download_uri="https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${flutter_version}.tar.xz"
|
||||
|
||||
RUN mkdir /home/user/Flutter && \
|
||||
curl -Lo /tmp/flutter.tar.xz "${download_uri}" && \
|
||||
tar -xf /tmp/flutter.tar.xz -C /home/user/Flutter && \
|
||||
rm /tmp/flutter.tar.xz
|
||||
|
||||
RUN echo 'export PATH="$HOME/Flutter/flutter/bin:$PATH"' >> /home/user/.bashrc
|
||||
RUN echo 'export FLUTTER_ROOT="$HOME/Flutter/flutter"' >> /home/user/.bashrc
|
||||
@@ -1,7 +1,15 @@
|
||||
FROM git.plabble.org/maurice/dotnet:main
|
||||
|
||||
ARG rider_version="2025.2.3"
|
||||
ARG rider_version="2025.2.4"
|
||||
ARG download_uri="https://download.jetbrains.com/rider/JetBrains.Rider-${rider_version}.tar.gz"
|
||||
|
||||
RUN curl -o /tmp/rider.tar.gz ${download_uri} && \
|
||||
tar -zxf /tmp/rider.tar.gz -C /home/user/Rider
|
||||
USER root
|
||||
RUN dnf -y install libXext libXrender libXtst libX11 freetype freetype-devel
|
||||
USER user
|
||||
|
||||
RUN curl -Lo /tmp/rider.tar.gz "${download_uri}" && \
|
||||
mkdir /home/user/Rider && \
|
||||
tar -zxf /tmp/rider.tar.gz -C /home/user/Rider && \
|
||||
rm /tmp/rider.tar.gz && \
|
||||
mv /home/user/Rider/JetBrains*/* /home/user/Rider
|
||||
|
||||
RUN echo 'alias rider="$HOME/Rider/bin/rider"' >> /home/user/.bashrc
|
||||
1
containers/rider/env
Normal file
1
containers/rider/env
Normal file
@@ -0,0 +1 @@
|
||||
DEVC_COMMAND=/home/user/Rider/bin/rider
|
||||
8
devc.sh
8
devc.sh
@@ -52,6 +52,10 @@ param_args() {
|
||||
case "$1" in
|
||||
-gpu) # Enable gpu acceleration.
|
||||
arg "--device /dev/dri" ;;
|
||||
-kvm) # Enable KVM
|
||||
arg "--device /dev/kvm" ;;
|
||||
-usb) # Enable USB access
|
||||
arg "--device /dev/bus/usb" ;;
|
||||
-host-spawn) # Enable spawning host commands from inside the container using host-spawn.
|
||||
arg "-v /run/user/$UID/bus:/tmp/bus"
|
||||
arg "-e HOST_HOME=$HOME" # Used to translate paths.
|
||||
@@ -85,6 +89,10 @@ else
|
||||
fi
|
||||
name="${image%:*}"
|
||||
|
||||
# check if ENV file is present, if so, source it
|
||||
env_file="$(dirname "$(realpath "$0")")/containers/$name/env"
|
||||
[ -f "$env_file" ] && source "${env_file}"
|
||||
|
||||
# Get container registry from the DEVC_REGISTRY env
|
||||
# variable.
|
||||
if [ -n "${DEVC_REGISTRY:-}" ]; then
|
||||
|
||||
Reference in New Issue
Block a user