+14
-4
@@ -4,8 +4,10 @@ FROM quay.io/fedora/fedora:44
|
|||||||
RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
|
RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
|
||||||
dnf update -y && \
|
dnf update -y && \
|
||||||
dnf -y --setopt=keepcache=1 --setopt=install_weak_deps=False install \
|
dnf -y --setopt=keepcache=1 --setopt=install_weak_deps=False install \
|
||||||
bash-completion git-core curl awk jq rg zip unzip which \
|
bash-completion git-core curl awk jq rg zip unzip which ncurses \
|
||||||
host-spawn wl-copy gcc helix helix-themes rsync python3 python3-pip dotnet-sdk-10.0 openssl-devel
|
host-spawn wl-copy gcc helix helix-themes rsync python3 python3-pip dotnet-sdk-10.0 openssl-devel \
|
||||||
|
alsa-lib-devel \ # Neginoth-project
|
||||||
|
|
||||||
|
|
||||||
# === setup user ===
|
# === setup user ===
|
||||||
RUN useradd -ms /bin/bash user && \
|
RUN useradd -ms /bin/bash user && \
|
||||||
@@ -45,7 +47,8 @@ RUN export RUSTUP_HOME=/usr/local/rust && \
|
|||||||
ln -sf /usr/local/rust/bin/rustfmt /usr/local/bin/rustfmt && \
|
ln -sf /usr/local/rust/bin/rustfmt /usr/local/bin/rustfmt && \
|
||||||
ln -sf /usr/local/rust/bin/clippy /usr/local/bin/clippy && \
|
ln -sf /usr/local/rust/bin/clippy /usr/local/bin/clippy && \
|
||||||
ln -sf /usr/local/rust/bin/rust-analyzer /usr/local/bin/rust-analyzer && \
|
ln -sf /usr/local/rust/bin/rust-analyzer /usr/local/bin/rust-analyzer && \
|
||||||
rustup component add rustfmt clippy rust-analyzer && \
|
rustup component add rustfmt clippy rust-analyzer rust-src && \
|
||||||
|
rustup target add wasm32-unknown-unknown && \
|
||||||
curl https://drager.github.io/wasm-pack/installer/init.sh -sSf | sh
|
curl https://drager.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||||
# cargo install cargo-generate && \
|
# cargo install cargo-generate && \
|
||||||
# cargo install cargo-expand
|
# cargo install cargo-expand
|
||||||
@@ -88,6 +91,13 @@ RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
|
|||||||
# === install language servers, tools ===
|
# === install language servers, tools ===
|
||||||
RUN deno i -g -f -A --root /usr/local/bin npm:npm npm:bash-language-server npm:vscode-langservers-extracted npm:dockerfile-language-server-nodejs \
|
RUN deno i -g -f -A --root /usr/local/bin npm:npm npm:bash-language-server npm:vscode-langservers-extracted npm:dockerfile-language-server-nodejs \
|
||||||
npm:typescript npm:typescript-language-server
|
npm:typescript npm:typescript-language-server
|
||||||
|
|
||||||
|
RUN mkdir -p /usr/local/bin/python-bins/code-review-graph && \
|
||||||
|
pip install code-review-graph --target /usr/local/bin/python-bins/code-review-graph && \
|
||||||
|
ln -sf /usr/local/bin/python-bins/code-review-graph/bin/code-review-graph /usr/local/bin/code-review-graph
|
||||||
|
|
||||||
|
# Ownership
|
||||||
|
RUN chown -R user:user /usr/local/rust
|
||||||
|
|
||||||
USER user
|
USER user
|
||||||
WORKDIR /home/user
|
WORKDIR /home/user
|
||||||
@@ -100,7 +110,7 @@ COPY --chown=user:user config/helix/ .config/helix/
|
|||||||
# === Cleanup build dependencies ===
|
# === Cleanup build dependencies ===
|
||||||
USER root
|
USER root
|
||||||
RUN dnf remove -y openssl-devel && dnf clean all && \
|
RUN dnf remove -y openssl-devel && dnf clean all && \
|
||||||
rm -rf /tmp/* && rm -rf /root/*
|
rm -rf /tmp/* && rm -rf /root/* && pip cache purge
|
||||||
|
|
||||||
USER user
|
USER user
|
||||||
|
|
||||||
|
|||||||
@@ -22,4 +22,4 @@ alias ga="git add -A"
|
|||||||
alias gf="git fetch"
|
alias gf="git fetch"
|
||||||
alias gp="git pull"
|
alias gp="git pull"
|
||||||
alias gpp="git push"
|
alias gpp="git push"
|
||||||
alias gs="git status"
|
alias gs="git status"
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ default_args() {
|
|||||||
"--userns=keep-id" # Map host user.
|
"--userns=keep-id" # Map host user.
|
||||||
"-v" "$name:/home/user:copy" # Persistent home volume.
|
"-v" "$name:/home/user:copy" # Persistent home volume.
|
||||||
"-v" "dnf-cache:/var/cache/libdnf5" # Cache dnf metadata.
|
"-v" "dnf-cache:/var/cache/libdnf5" # Cache dnf metadata.
|
||||||
|
"-v" "$HOME/dev:/home/user/dev" # dev folder
|
||||||
)
|
)
|
||||||
|
|
||||||
# Unix sockets require SELinux label disable.
|
# Unix sockets require SELinux label disable.
|
||||||
@@ -38,6 +39,7 @@ param_args() {
|
|||||||
-gpu) run_opts+=("--device" "/dev/dri") ;;
|
-gpu) run_opts+=("--device" "/dev/dri") ;;
|
||||||
-kvm) run_opts+=("--device" "/dev/kvm") ;;
|
-kvm) run_opts+=("--device" "/dev/kvm") ;;
|
||||||
-usb) run_opts+=("--device" "/dev/bus/usb") ;;
|
-usb) run_opts+=("--device" "/dev/bus/usb") ;;
|
||||||
|
-audio) run_opts+=("--device" "/dev/snd") ;;
|
||||||
-host-spawn) run_opts+=("-v" "/run/user/$UID/bus:/tmp/bus" "-e" "HOST_HOME=$HOME") ;;
|
-host-spawn) run_opts+=("-v" "/run/user/$UID/bus:/tmp/bus" "-e" "HOST_HOME=$HOME") ;;
|
||||||
-container-sock) run_opts+=("-v" "$XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock") ;;
|
-container-sock) run_opts+=("-v" "$XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock") ;;
|
||||||
-x11) run_opts+=("-v" "/tmp/.X11-unix:/tmp/.X11-unix" "-v" "$XAUTHORITY:/run/user/1000/.Xauthority:ro" "-e" "DISPLAY=$DISPLAY" "-e" "XAUTHORITY=/run/user/1000/.Xauthority") ;;
|
-x11) run_opts+=("-v" "/tmp/.X11-unix:/tmp/.X11-unix" "-v" "$XAUTHORITY:/run/user/1000/.Xauthority:ro" "-e" "DISPLAY=$DISPLAY" "-e" "XAUTHORITY=/run/user/1000/.Xauthority") ;;
|
||||||
@@ -50,19 +52,8 @@ param_args() {
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
local state_file="$HOME/.local/share/devc-previous-container"
|
local state_file="$HOME/.local/share/devc-previous-container"
|
||||||
local image="devc"
|
local image="devc:main"
|
||||||
|
local name="devc"
|
||||||
# Resolve container name (CLI arg > Last used > Error).
|
|
||||||
if [[ $image && $image != -* ]]; then
|
|
||||||
shift
|
|
||||||
[[ $image != *:* ]] && image+=":main"
|
|
||||||
echo "$image" >"$state_file"
|
|
||||||
elif [[ -f $state_file ]]; then
|
|
||||||
image=$(<$state_file)
|
|
||||||
else
|
|
||||||
die "no container name specified"
|
|
||||||
fi
|
|
||||||
local name="${image%:*}"
|
|
||||||
|
|
||||||
# Start/Restart if not running or if arguments change configuration.
|
# Start/Restart if not running or if arguments change configuration.
|
||||||
if [[ -z "$(podman ps -q -f name="^$name$" -f status=running)" ]] || (($# > 0)); then
|
if [[ -z "$(podman ps -q -f name="^$name$" -f status=running)" ]] || (($# > 0)); then
|
||||||
|
|||||||
Reference in New Issue
Block a user