From e0ebb5e5bc4b819c1d50a1c5ae9aabfa934113b1 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Thu, 2 Jul 2026 09:53:01 +0200 Subject: [PATCH] feat: launch scripts, dockerfiles for more languages --- README.md | 8 ++++++- base/Dockerfile | 7 ++++-- build.sh | 22 +++++++++++++++++-- npm/Dockerfile | 2 ++ npm/docker-compose.yml | 0 php/Dockerfile | 3 +++ php/docker-compose.yml | 0 scripts/base-container | 16 ++++++++++++++ .../export-volume.sh => scripts/export-volume | 0 .../import-volume.sh => scripts/import-volume | 0 scripts/node-container | 16 ++++++++++++++ scripts/php-container | 16 ++++++++++++++ scripts/python-container | 16 ++++++++++++++ .../torch-rocm-container | 0 scripts/vue-container | 16 ++++++++++++++ scripts/webserver-container | 13 +++++++++++ vue/Dockerfile | 2 ++ 17 files changed, 132 insertions(+), 5 deletions(-) delete mode 100644 npm/docker-compose.yml delete mode 100644 php/docker-compose.yml create mode 100755 scripts/base-container rename volume-export/export-volume.sh => scripts/export-volume (100%) rename volume-export/import-volume.sh => scripts/import-volume (100%) create mode 100755 scripts/node-container create mode 100755 scripts/php-container create mode 100755 scripts/python-container rename torch-rocm/add-container.sh => scripts/torch-rocm-container (100%) create mode 100755 scripts/vue-container create mode 100755 scripts/webserver-container diff --git a/README.md b/README.md index 2456887..4aa3881 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ # dev-env Utilities for a more secure development environment. -Docker container build resources for all the languages I use regularly \ No newline at end of file +Docker container build resources for all the languages I use regularly + +The scripts directory here contains scripts to create a docker container. +Each of them takes as arguments first the container name, then the folder to mount. + +My [dotfiles](https://git.janishutz.com/janishutz/dotfiles) also have a script that is a +one-stop solution for all of the containers, and also features autocomplete diff --git a/base/Dockerfile b/base/Dockerfile index 2228279..a4a707b 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -1,5 +1,8 @@ FROM archlinux +LABEL org.opencontainers.image.title="janishutz dev containers base" +LABEL org.opencontainers.image.description="janishutz dev containers base image, off which other containers are to be based" + RUN pacman --noconfirm -Sy fish wget git -# TODO: Finish -# RUN wget https://git.janishutz.com/ + +CMD [ "fish" ] diff --git a/build.sh b/build.sh index a628cfe..f6370d7 100755 --- a/build.sh +++ b/build.sh @@ -1,13 +1,31 @@ #!/bin/sh +echo " +Building base container +" cd base docker buildx build . -t git.janishutz.com/registry/dev-container-base +echo " +Building npm container +" cd ../npm docker buildx build . -t git.janishutz.com/registry/dev-container-npm -# cd ../vue -# docker buildx build . -t git.janishutz.com/registry/dev-container-vue +echo " +Building Vue container +" +cd ../vue +docker buildx build . -t git.janishutz.com/registry/dev-container-vue # +# echo " +# Building Python container +# " # cd ../python # docker buildx build . -t git.janishutz.com/registry/dev-container-python +# +# echo " +# Building php container +# " +# cd ../php +# docker buildx build . -t git.janishutz.com/registry/dev-container-php diff --git a/npm/Dockerfile b/npm/Dockerfile index 914b101..0fe1532 100644 --- a/npm/Dockerfile +++ b/npm/Dockerfile @@ -1,3 +1,5 @@ FROM git.janishutz.com/registry/dev-container-base RUN pacman --noconfirm -S nodejs npm yarn + +RUN npm i -g express express-session @types/express @types/express-session diff --git a/npm/docker-compose.yml b/npm/docker-compose.yml deleted file mode 100644 index e69de29..0000000 diff --git a/php/Dockerfile b/php/Dockerfile index e69de29..1a0100b 100644 --- a/php/Dockerfile +++ b/php/Dockerfile @@ -0,0 +1,3 @@ +FROM git.janishutz.com/registry/dev-container-base + +RUN pacman --noconfirm -S composer php diff --git a/php/docker-compose.yml b/php/docker-compose.yml deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/base-container b/scripts/base-container new file mode 100755 index 0000000..d3ce017 --- /dev/null +++ b/scripts/base-container @@ -0,0 +1,16 @@ +#!/bin/sh + +containername=$([[ $1 ]] && echo $1 || echo "devcontainer") +containermount=$([[ $2 ]] && echo $2 || echo "$HOME/projects/") + +echo " +=> Mounting folder to /mnt +" + +docker run -it \ + -v $containermount:/mnt \ + -v ~/.config/fish:/root/.config/fish \ + -v ~/projects/system/dotfiles/scripts/:/root/projects/system/dotfiles \ + --name $containername \ + -w /mnt \ + git.janishutz.com/registry/dev-container-base diff --git a/volume-export/export-volume.sh b/scripts/export-volume similarity index 100% rename from volume-export/export-volume.sh rename to scripts/export-volume diff --git a/volume-export/import-volume.sh b/scripts/import-volume similarity index 100% rename from volume-export/import-volume.sh rename to scripts/import-volume diff --git a/scripts/node-container b/scripts/node-container new file mode 100755 index 0000000..a4e7728 --- /dev/null +++ b/scripts/node-container @@ -0,0 +1,16 @@ +#!/bin/sh + +containername=$([[ $1 ]] && echo $1 || echo "node") +containermount=$([[ $2 ]] && echo $2 || echo "$HOME/projects/") + +echo " +=> Mounting folder to /mnt (in container) +" + +docker run -it \ + -v $containermount:/mnt \ + -v ~/.config/fish:/root/.config/fish \ + -v ~/projects/system/dotfiles/scripts/:/root/projects/system/dotfiles \ + --name $containername \ + -w /mnt \ + git.janishutz.com/registry/dev-container-npm diff --git a/scripts/php-container b/scripts/php-container new file mode 100755 index 0000000..2bd1c3a --- /dev/null +++ b/scripts/php-container @@ -0,0 +1,16 @@ +#!/bin/sh + +containername=$([[ $1 ]] && echo $1 || echo "php") +containermount=$([[ $2 ]] && echo $2 || echo "$HOME/projects/") + +echo " +=> Mounting folder to /mnt +" + +docker run -it \ + -v $containermount:/mnt \ + -v ~/.config/fish:/root/.config/fish \ + -v ~/projects/system/dotfiles/scripts/:/root/projects/system/dotfiles \ + --name $containername \ + -w /mnt \ + git.janishutz.com/registry/dev-container-php diff --git a/scripts/python-container b/scripts/python-container new file mode 100755 index 0000000..9bd0809 --- /dev/null +++ b/scripts/python-container @@ -0,0 +1,16 @@ +#!/bin/sh + +containername=$([[ $1 ]] && echo $1 || echo "python") +containermount=$([[ $2 ]] && echo $2 || echo "$HOME/projects/") + +echo " +=> Mounting folder to /mnt (in container) +" + +docker run -it \ + -v $containermount:/mnt \ + -v ~/.config/fish:/root/.config/fish \ + -v ~/projects/system/dotfiles/scripts/:/root/projects/system/dotfiles \ + --name $containername \ + -w /mnt \ + git.janishutz.com/registry/dev-container-python diff --git a/torch-rocm/add-container.sh b/scripts/torch-rocm-container similarity index 100% rename from torch-rocm/add-container.sh rename to scripts/torch-rocm-container diff --git a/scripts/vue-container b/scripts/vue-container new file mode 100755 index 0000000..c272b14 --- /dev/null +++ b/scripts/vue-container @@ -0,0 +1,16 @@ +#!/bin/sh + +containername=$([[ $1 ]] && echo $1 || echo "vue") +containermount=$([[ $2 ]] && echo $2 || echo "$HOME/projects/") + +echo " +=> Mounting folder to /mnt (in container) +" + +docker run -it \ + -v $containermount:/mnt \ + -v ~/.config/fish:/root/.config/fish \ + -v ~/projects/system/dotfiles/scripts/:/root/projects/system/dotfiles \ + --name $containername \ + -w /mnt \ + git.janishutz.com/registry/dev-container-vue diff --git a/scripts/webserver-container b/scripts/webserver-container new file mode 100755 index 0000000..5964302 --- /dev/null +++ b/scripts/webserver-container @@ -0,0 +1,13 @@ +#!/bin/sh + +containername=$([[ $1 ]] && echo $1 || echo "webserver") +containermount=$([[ $2 ]] && echo $2 || echo "$HOME/projects/") + +echo " +=> Mounting folder to /mnt +" + +docker run --rm \ + -v $containermount:/mnt \ + git.janishutz.com/registry/dev-container-base +# TODO: Update the used image diff --git a/vue/Dockerfile b/vue/Dockerfile index 70d2859..78f2d11 100644 --- a/vue/Dockerfile +++ b/vue/Dockerfile @@ -1 +1,3 @@ FROM git.janishutz.com/registry/dev-container-npm + +RUN npm i -g create-vue vite typescript-eslint @eslint/js @stylistic/eslint-plugin eslint-plugin-vue globals