From 97a21c476da9a1541d4a32289767b838bb54d0d8 Mon Sep 17 00:00:00 2001 From: Howard Tseng Date: Mon, 16 Sep 2024 23:36:19 -0400 Subject: [PATCH 01/10] code-server-python3poetry: initial release --- Dockerfile | 2 +- README.md | 26 +++------------- .../dependencies.d/init-mods | 0 .../run | 14 +++++++++ .../type | 0 .../up | 0 .../dependencies.d/init-mods-package-install | 0 .../run | 11 +++++-- .../type | 0 .../up | 0 .../run | 30 ------------------- 11 files changed, 28 insertions(+), 55 deletions(-) rename root/etc/s6-overlay/s6-rc.d/{init-mod-imagename-modname-add-package => init-mod-code-server-python3poetry-add-package}/dependencies.d/init-mods (100%) create mode 100644 root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/run rename root/etc/s6-overlay/s6-rc.d/{init-mod-imagename-modname-add-package => init-mod-code-server-python3poetry-add-package}/type (100%) rename root/etc/s6-overlay/s6-rc.d/{init-mod-imagename-modname-add-package => init-mod-code-server-python3poetry-add-package}/up (100%) rename root/etc/s6-overlay/s6-rc.d/{init-mod-imagename-modname-install => init-mod-code-server-python3poetry-install}/dependencies.d/init-mods-package-install (100%) rename root/etc/s6-overlay/s6-rc.d/{init-mod-imagename-modname-install => init-mod-code-server-python3poetry-install}/run (52%) mode change 100755 => 100644 rename root/etc/s6-overlay/s6-rc.d/{init-mod-imagename-modname-install => init-mod-code-server-python3poetry-install}/type (100%) rename root/etc/s6-overlay/s6-rc.d/{init-mod-imagename-modname-install => init-mod-code-server-python3poetry-install}/up (100%) delete mode 100755 root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/run diff --git a/Dockerfile b/Dockerfile index aa661704..72aed797 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM scratch -LABEL maintainer="username" +LABEL maintainer="howardt12345" # copy local files COPY root/ / diff --git a/README.md b/README.md index 17006683..4566a370 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,7 @@ -# Rsync - Docker mod for openssh-server +# Python3 + Poetry - Docker mod for code-server/openvscode-server -This mod adds rsync to openssh-server, to be installed/updated during container start. +This mod adds a python3 dev environment to code-server/openvscode-server, to be installed/updated during container start, setting up a python3 environment with poetry. -In openssh-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:openssh-server-rsync` +In code-server/openvscode-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:code-server-python3poetry` -If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:openssh-server-rsync|linuxserver/mods:openssh-server-mod2` - -# Mod creation instructions - -* Fork the repo, create a new branch based on the branch `template`. -* Edit the `Dockerfile` for the mod. `Dockerfile.complex` is only an example and included for reference; it should be deleted when done. -* Inspect the `root` folder contents. Edit, add and remove as necessary. -* After all init scripts and services are created, run `find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print -exec chmod +x {} +` to fix permissions. -* Edit this readme with pertinent info, delete these instructions. -* Finally edit the `.github/workflows/BuildImage.yml`. Customize the vars for `BASEIMAGE` and `MODNAME`. Set the versioning logic and `MULTI_ARCH` if needed. -* Ask the team to create a new branch named `-`. Baseimage should be the name of the image the mod will be applied to. The new branch will be based on the `template` branch. -* Submit PR against the branch created by the team. - - -## Tips and tricks - -* Some images have helpers built in, these images are currently: - * [Openvscode-server](https://github.com/linuxserver/docker-openvscode-server/pull/10/files) - * [Code-server](https://github.com/linuxserver/docker-code-server/pull/95) +If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:code-server-python3poetry|linuxserver/mods:code-server-mod2` \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/dependencies.d/init-mods b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/dependencies.d/init-mods similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/dependencies.d/init-mods rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/dependencies.d/init-mods diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/run b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/run new file mode 100644 index 00000000..6bfad731 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/run @@ -0,0 +1,14 @@ +#!/usr/bin/with-contenv bash + +if ! dpkg -l | grep python3-dev > /dev/null; then + echo "**** Adding python3 to package install list ****" + echo "\ + build-essential \ + libssl-dev \ + libffi-dev \ + python3-dev \ + python3-pip \ + python3-venv" >> /mod-repo-packages-to-install.list +else + echo "**** python3 already installed ****" +fi \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/type b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/type similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/type rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/type diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/up b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/up similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/up rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/up diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/dependencies.d/init-mods-package-install b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/dependencies.d/init-mods-package-install similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/dependencies.d/init-mods-package-install rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/dependencies.d/init-mods-package-install diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/run b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/run old mode 100755 new mode 100644 similarity index 52% rename from root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/run rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/run index 59a4b77f..b4d0067c --- a/root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/run +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/run @@ -4,5 +4,12 @@ # so it can take advantage of packages installed # init-mods-end depends on this script so that later init and services wait until this script exits -echo "**** Setting up apprise ****" -apprise blah blah +echo "**** Setting up poetry ****" + +# Install poetry +curl -sSL https://install.python-poetry.org | python3 - + +# Add poetry to the path +echo "export PATH=\"\$HOME/.local/bin:\$PATH\"" >> /root/.bashrc + +echo "**** poetry setup complete ****" \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/type b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/type similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/type rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/type diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/up b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/up similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/up rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/up diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/run b/root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/run deleted file mode 100755 index 063b5701..00000000 --- a/root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/run +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/with-contenv bash - -# This is the init file used for adding os or pip packages to install lists. -# It takes advantage of the built-in init-mods-package-install init script that comes with the baseimages. -# If using this, we need to make sure we set this init as a dependency of init-mods-package-install so this one runs first - -if ! command -v apprise; then - echo "**** Adding apprise and its deps to package install lists ****" - echo "apprise" >> /mod-pip-packages-to-install.list - ## Ubuntu - if [ -f /usr/bin/apt ]; then - echo "\ - python3 \ - python3-pip \ - runc" >> /mod-repo-packages-to-install.list - fi - # Alpine - if [ -f /sbin/apk ]; then - echo "\ - cargo \ - libffi-dev \ - openssl-dev \ - python3 \ - python3-dev \ - python3 \ - py3-pip" >> /mod-repo-packages-to-install.list - fi -else - echo "**** apprise already installed, skipping ****" -fi From 37b3f0b1f0918ca43e8f308a32ee9151d0a5f8a7 Mon Sep 17 00:00:00 2001 From: Howard Tseng Date: Mon, 16 Sep 2024 23:38:30 -0400 Subject: [PATCH 02/10] cleanup --- .../dependencies.d/init-mod-imagename-modname-install | 0 .../svc-mod-imagename-modname/dependencies.d/init-services | 0 root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/run | 7 ------- root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/type | 1 - 4 files changed, 8 deletions(-) delete mode 100644 root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mod-imagename-modname-install delete mode 100644 root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/dependencies.d/init-services delete mode 100755 root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/run delete mode 100644 root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/type diff --git a/root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mod-imagename-modname-install b/root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mod-imagename-modname-install deleted file mode 100644 index e69de29b..00000000 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/dependencies.d/init-services b/root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/dependencies.d/init-services deleted file mode 100644 index e69de29b..00000000 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/run b/root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/run deleted file mode 100755 index 02ffe39a..00000000 --- a/root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/run +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/with-contenv bash - -# This is an example service that would run for the mod -# It depends on init-services, the baseimage hook for start of all longrun services - -exec \ - s6-setuidgid abc run my app diff --git a/root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/type b/root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/type deleted file mode 100644 index 1780f9f4..00000000 --- a/root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/type +++ /dev/null @@ -1 +0,0 @@ -longrun \ No newline at end of file From 084642aabeac5f3535ac5f39e023d1a8385250af Mon Sep 17 00:00:00 2001 From: Howard Tseng Date: Mon, 16 Sep 2024 23:41:51 -0400 Subject: [PATCH 03/10] update workflow --- .github/workflows/BuildImage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildImage.yml b/.github/workflows/BuildImage.yml index 4715e563..6e23afc1 100644 --- a/.github/workflows/BuildImage.yml +++ b/.github/workflows/BuildImage.yml @@ -12,8 +12,8 @@ on: env: GITHUB_REPO: "linuxserver/docker-mods" #don't modify ENDPOINT: "linuxserver/mods" #don't modify - BASEIMAGE: "replace_baseimage" #replace - MODNAME: "replace_modname" #replace + BASEIMAGE: "code-server" #replace + MODNAME: "python3poetry" #replace MOD_VERSION: ${{ inputs.mod_version }} #don't modify MULTI_ARCH: "true" #set to false if not needed From fc239eeed52012cab5603940203dcc7122e4e2ad Mon Sep 17 00:00:00 2001 From: Howard Tseng Date: Mon, 16 Sep 2024 23:45:29 -0400 Subject: [PATCH 04/10] refactor: python3-poetry --- .github/workflows/BuildImage.yml | 2 +- .../dependencies.d/init-mods | 0 .../run | 0 .../type | 0 .../up | 0 .../dependencies.d/init-mods-package-install | 0 .../run | 0 .../type | 0 .../up | 0 9 files changed, 1 insertion(+), 1 deletion(-) rename root/etc/s6-overlay/s6-rc.d/{init-mod-code-server-python3poetry-add-package => init-mod-code-server-python3-poetry-add-package}/dependencies.d/init-mods (100%) rename root/etc/s6-overlay/s6-rc.d/{init-mod-code-server-python3poetry-add-package => init-mod-code-server-python3-poetry-add-package}/run (100%) rename root/etc/s6-overlay/s6-rc.d/{init-mod-code-server-python3poetry-add-package => init-mod-code-server-python3-poetry-add-package}/type (100%) rename root/etc/s6-overlay/s6-rc.d/{init-mod-code-server-python3poetry-add-package => init-mod-code-server-python3-poetry-add-package}/up (100%) rename root/etc/s6-overlay/s6-rc.d/{init-mod-code-server-python3poetry-install => init-mod-code-server-python3-poetry-install}/dependencies.d/init-mods-package-install (100%) rename root/etc/s6-overlay/s6-rc.d/{init-mod-code-server-python3poetry-install => init-mod-code-server-python3-poetry-install}/run (100%) rename root/etc/s6-overlay/s6-rc.d/{init-mod-code-server-python3poetry-install => init-mod-code-server-python3-poetry-install}/type (100%) rename root/etc/s6-overlay/s6-rc.d/{init-mod-code-server-python3poetry-install => init-mod-code-server-python3-poetry-install}/up (100%) diff --git a/.github/workflows/BuildImage.yml b/.github/workflows/BuildImage.yml index 6e23afc1..a6c0ef0f 100644 --- a/.github/workflows/BuildImage.yml +++ b/.github/workflows/BuildImage.yml @@ -13,7 +13,7 @@ env: GITHUB_REPO: "linuxserver/docker-mods" #don't modify ENDPOINT: "linuxserver/mods" #don't modify BASEIMAGE: "code-server" #replace - MODNAME: "python3poetry" #replace + MODNAME: "python3-poetry" #replace MOD_VERSION: ${{ inputs.mod_version }} #don't modify MULTI_ARCH: "true" #set to false if not needed diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/dependencies.d/init-mods b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/dependencies.d/init-mods similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/dependencies.d/init-mods rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/dependencies.d/init-mods diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/run b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/run similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/run rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/type b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/type similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/type rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/type diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/up b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/up similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-add-package/up rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/up diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/dependencies.d/init-mods-package-install b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/dependencies.d/init-mods-package-install similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/dependencies.d/init-mods-package-install rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/dependencies.d/init-mods-package-install diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/run b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/run rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/type b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/type similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/type rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/type diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/up b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/up similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3poetry-install/up rename to root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/up From 1fd61408c9a49df35f1c648fc22ccbea6ef80850 Mon Sep 17 00:00:00 2001 From: Howard Tseng Date: Mon, 16 Sep 2024 23:52:07 -0400 Subject: [PATCH 05/10] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4566a370..dfe91f8f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,6 @@ This mod adds a python3 dev environment to code-server/openvscode-server, to be installed/updated during container start, setting up a python3 environment with poetry. -In code-server/openvscode-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:code-server-python3poetry` +In code-server/openvscode-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:code-server-python3-poetry` -If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:code-server-python3poetry|linuxserver/mods:code-server-mod2` \ No newline at end of file +If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:code-server-python3-poetry|linuxserver/mods:code-server-mod2` \ No newline at end of file From 4bc06fac34545fbe372a779ee44794030b9e19db Mon Sep 17 00:00:00 2001 From: Howard Tseng Date: Tue, 17 Sep 2024 22:06:21 -0400 Subject: [PATCH 06/10] fixes --- .../s6-rc.d/init-mod-code-server-python3-poetry-add-package/up | 2 +- .../s6-rc.d/init-mod-code-server-python3-poetry-install/up | 2 +- .../dependencies.d/init-mod-code-server-python3-poetry-install} | 0 .../init-mod-code-server-python3-poetry-add-package} | 0 ...-install => init-mod-code-server-python3-poetry-add-package} | 0 ...name-modname => init-mod-code-server-python3-poetry-install} | 0 6 files changed, 2 insertions(+), 2 deletions(-) rename root/etc/s6-overlay/s6-rc.d/{init-mods-package-install/dependencies.d/init-mod-imagename-modname-add-package => init-mods-end/dependencies.d/init-mod-code-server-python3-poetry-install} (100%) rename root/etc/s6-overlay/s6-rc.d/{user/contents.d/init-mod-imagename-modname-add-package => init-mods-package-install/dependencies.d/init-mod-code-server-python3-poetry-add-package} (100%) rename root/etc/s6-overlay/s6-rc.d/user/contents.d/{init-mod-imagename-modname-install => init-mod-code-server-python3-poetry-add-package} (100%) rename root/etc/s6-overlay/s6-rc.d/user/contents.d/{svc-mod-imagename-modname => init-mod-code-server-python3-poetry-install} (100%) diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/up b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/up index 6414139f..10b89da7 100644 --- a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/up +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/up @@ -1 +1 @@ -/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/run \ No newline at end of file +/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/run \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/up b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/up index 03d298d2..67119a79 100644 --- a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/up +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/up @@ -1 +1 @@ -/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/run \ No newline at end of file +/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/dependencies.d/init-mod-imagename-modname-add-package b/root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mod-code-server-python3-poetry-install similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-mods-package-install/dependencies.d/init-mod-imagename-modname-add-package rename to root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mod-code-server-python3-poetry-install diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-imagename-modname-add-package b/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/dependencies.d/init-mod-code-server-python3-poetry-add-package similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-imagename-modname-add-package rename to root/etc/s6-overlay/s6-rc.d/init-mods-package-install/dependencies.d/init-mod-code-server-python3-poetry-add-package diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-imagename-modname-install b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-code-server-python3-poetry-add-package similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-imagename-modname-install rename to root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-code-server-python3-poetry-add-package diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-mod-imagename-modname b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-code-server-python3-poetry-install similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-mod-imagename-modname rename to root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-code-server-python3-poetry-install From 77d1fef46235ccbcef7aaddca16455a8cb91a4d1 Mon Sep 17 00:00:00 2001 From: howardt12345 Date: Tue, 17 Sep 2024 22:30:04 -0400 Subject: [PATCH 07/10] fixed permissions --- .../s6-rc.d/init-mod-code-server-python3-poetry-add-package/run | 0 .../s6-rc.d/init-mod-code-server-python3-poetry-install/run | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/run mode change 100644 => 100755 root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/run b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/run old mode 100644 new mode 100755 diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run old mode 100644 new mode 100755 From 18367bd1b1e49fb88bbe09301a91d6bb2b267177 Mon Sep 17 00:00:00 2001 From: Howard Tseng Date: Sat, 28 Sep 2024 21:41:43 -0400 Subject: [PATCH 08/10] Apply suggestions from code review Signed-off-by: Howard Tseng --- .github/workflows/BuildImage.yml | 2 +- .../s6-rc.d/init-mod-code-server-python3-poetry-install/run | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildImage.yml b/.github/workflows/BuildImage.yml index a6c0ef0f..cc955b25 100644 --- a/.github/workflows/BuildImage.yml +++ b/.github/workflows/BuildImage.yml @@ -15,7 +15,7 @@ env: BASEIMAGE: "code-server" #replace MODNAME: "python3-poetry" #replace MOD_VERSION: ${{ inputs.mod_version }} #don't modify - MULTI_ARCH: "true" #set to false if not needed + MULTI_ARCH: "false" jobs: set-vars: diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run index b4d0067c..6603c3b7 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run @@ -10,6 +10,9 @@ echo "**** Setting up poetry ****" curl -sSL https://install.python-poetry.org | python3 - # Add poetry to the path -echo "export PATH=\"\$HOME/.local/bin:\$PATH\"" >> /root/.bashrc +echo "**** ensuring poetry is in PATH ****" +if ! grep -q "$HOME/.local/bin" /var/run/s6/container_environment/PATH; then + printf ':$HOME/.local/bin' >> /var/run/s6/container_environment/PATH +fi echo "**** poetry setup complete ****" \ No newline at end of file From 86aa45d2421863b69e556348071d06724370f0c3 Mon Sep 17 00:00:00 2001 From: howardt12345 Date: Sat, 28 Sep 2024 21:42:26 -0400 Subject: [PATCH 09/10] cleanup --- Dockerfile.complex | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 Dockerfile.complex diff --git a/Dockerfile.complex b/Dockerfile.complex deleted file mode 100644 index 3ed07b0d..00000000 --- a/Dockerfile.complex +++ /dev/null @@ -1,33 +0,0 @@ -# syntax=docker/dockerfile:1 - -## Buildstage ## -FROM ghcr.io/linuxserver/baseimage-alpine:3.20 AS buildstage - -RUN \ - echo "**** install packages ****" && \ - apk add --no-cache \ - curl && \ - echo "**** grab rclone ****" && \ - mkdir -p /root-layer && \ - if [ $(uname -m) = "x86_64" ]; then \ - echo "Downloading x86_64 tarball" && \ - curl -o \ - /root-layer/rclone.deb -L \ - "https://downloads.rclone.org/v1.47.0/rclone-v1.47.0-linux-amd64.deb"; \ - elif [ $(uname -m) = "aarch64" ]; then \ - echo "Downloading aarch64 tarball" && \ - curl -o \ - /root-layer/rclone.deb -L \ - "https://downloads.rclone.org/v1.47.0/rclone-v1.47.0-linux-arm64.deb"; \ - fi && \ - -# copy local files -COPY root/ /root-layer/ - -## Single layer deployed image ## -FROM scratch - -LABEL maintainer="username" - -# Add files from buildstage -COPY --from=buildstage /root-layer/ / From 955bd728dfe474af83de78c22967063403a927b8 Mon Sep 17 00:00:00 2001 From: howardt12345 Date: Sat, 28 Sep 2024 21:43:20 -0400 Subject: [PATCH 10/10] cleanup comment block --- .../s6-rc.d/init-mod-code-server-python3-poetry-install/run | 4 ---- 1 file changed, 4 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run index 6603c3b7..585dff08 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run @@ -1,9 +1,5 @@ #!/usr/bin/with-contenv bash -# This is an install script that is designed to run after init-mods-package-install -# so it can take advantage of packages installed -# init-mods-end depends on this script so that later init and services wait until this script exits - echo "**** Setting up poetry ****" # Install poetry