Skip to content

Commit c209718

Browse files
authored
Merge pull request #959 from howardt12345/code-server-python3poetry
code-server: python3-poetry initial release
2 parents 6360fcf + 955bd72 commit c209718

File tree

24 files changed

+38
-107
lines changed

24 files changed

+38
-107
lines changed

.github/workflows/BuildImage.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ on:
1212
env:
1313
GITHUB_REPO: "linuxserver/docker-mods" #don't modify
1414
ENDPOINT: "linuxserver/mods" #don't modify
15-
BASEIMAGE: "replace_baseimage" #replace
16-
MODNAME: "replace_modname" #replace
15+
BASEIMAGE: "code-server" #replace
16+
MODNAME: "python3-poetry" #replace
1717
MOD_VERSION: ${{ inputs.mod_version }} #don't modify
18-
MULTI_ARCH: "true" #set to false if not needed
18+
MULTI_ARCH: "false"
1919

2020
jobs:
2121
set-vars:

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FROM scratch
44

5-
LABEL maintainer="username"
5+
LABEL maintainer="howardt12345"
66

77
# copy local files
88
COPY root/ /

Dockerfile.complex

-33
This file was deleted.

README.md

+4-22
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
1-
# Rsync - Docker mod for openssh-server
1+
# Python3 + Poetry - Docker mod for code-server/openvscode-server
22

3-
This mod adds rsync to openssh-server, to be installed/updated during container start.
3+
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.
44

5-
In openssh-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:openssh-server-rsync`
5+
In code-server/openvscode-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:code-server-python3-poetry`
66

7-
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`
8-
9-
# Mod creation instructions
10-
11-
* Fork the repo, create a new branch based on the branch `template`.
12-
* Edit the `Dockerfile` for the mod. `Dockerfile.complex` is only an example and included for reference; it should be deleted when done.
13-
* Inspect the `root` folder contents. Edit, add and remove as necessary.
14-
* 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.
15-
* Edit this readme with pertinent info, delete these instructions.
16-
* Finally edit the `.github/workflows/BuildImage.yml`. Customize the vars for `BASEIMAGE` and `MODNAME`. Set the versioning logic and `MULTI_ARCH` if needed.
17-
* Ask the team to create a new branch named `<baseimagename>-<modname>`. Baseimage should be the name of the image the mod will be applied to. The new branch will be based on the `template` branch.
18-
* Submit PR against the branch created by the team.
19-
20-
21-
## Tips and tricks
22-
23-
* Some images have helpers built in, these images are currently:
24-
* [Openvscode-server](https://github.com/linuxserver/docker-openvscode-server/pull/10/files)
25-
* [Code-server](https://github.com/linuxserver/docker-code-server/pull/95)
7+
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`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
if ! dpkg -l | grep python3-dev > /dev/null; then
4+
echo "**** Adding python3 to package install list ****"
5+
echo "\
6+
build-essential \
7+
libssl-dev \
8+
libffi-dev \
9+
python3-dev \
10+
python3-pip \
11+
python3-venv" >> /mod-repo-packages-to-install.list
12+
else
13+
echo "**** python3 already installed ****"
14+
fi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-add-package/run
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
echo "**** Setting up poetry ****"
4+
5+
# Install poetry
6+
curl -sSL https://install.python-poetry.org | python3 -
7+
8+
# Add poetry to the path
9+
echo "**** ensuring poetry is in PATH ****"
10+
if ! grep -q "$HOME/.local/bin" /var/run/s6/container_environment/PATH; then
11+
printf ':$HOME/.local/bin' >> /var/run/s6/container_environment/PATH
12+
fi
13+
14+
echo "**** poetry setup complete ****"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/s6-overlay/s6-rc.d/init-mod-code-server-python3-poetry-install/run

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/run

-30
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/up

-1
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/run

-8
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/up

-1
This file was deleted.

root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/run

-7
This file was deleted.

root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/type

-1
This file was deleted.

root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-imagename-modname-install

Whitespace-only changes.

root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-mod-imagename-modname

Whitespace-only changes.

0 commit comments

Comments
 (0)