|
2 | 2 |
|
3 | 3 | # Python Dev Container |
4 | 4 |
|
5 | | -This repo is the base for the League's Python environment for devcontainers. You can use this as the base for |
6 | | -new repos, but generally it is better to use the config `.devcontainer/devcontainer-base.json`, |
7 | | -which uses the prebuild image from this repo. |
| 5 | +This repo is the base for the League's Python environment for devcontainers. |
8 | 6 |
|
9 | | -## Prebuilding |
| 7 | +The image is built with a Github action and is available here: |
10 | 8 |
|
11 | | -Prebuilding the container will result in much faster start-up times |
12 | | -for the container. |
13 | | - |
14 | | -* Get an access token from the [jointheleague-it](https://github.com/jointheleague-it) account, with the |
15 | | - package permissions. [See this guide for details. ](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-with-a-personal-access-token-classic) |
16 | | -* Store the token for future use, here is it ``GITHUB_TOKEN`` but it can be any env var. |
17 | | -* Login to the GH Container Registry: ``echo $GITHUB_TOKEN | docker login ghcr.io -u jointheleague-it --password-stdin`` |
18 | | -* Read the brief [guide to prebuilding](https://containers.dev/implementors/reference). Be sure to install the decvontainer program with npm. |
19 | | -* Build the container |
20 | | -* Push it to container registry. |
21 | | - |
22 | | -```bash |
23 | | - |
24 | | -# Install |
25 | | -npm install -g @devcontainers/cli |
26 | | - |
27 | | -# Go to the workspace. |
28 | | -cd <workspace, with a .devcontainer> |
29 | | - |
30 | | -# Build |
31 | | -IMAGE_NAME=jtlpython:20240719 |
32 | | -devcontainer build --workspace-folder . --image-name ghcr.io/league-infrastructure/$IMAGE_NAME |
33 | | - |
34 | | -#Login to container registry |
35 | | -echo $GITHUB_TOKEN | docker login ghcr.io -u jointheleague-it --password-stdin |
36 | | - |
37 | | -# Push |
38 | | -docker push ghcr.io/league-infrastructure/$IMAGE_NAME |
39 | | - |
40 | | -The package will be in the packages tab of the [League-Infrastructure](https://github.com/league-infrastructure) repo, https://github.com/orgs/league-infrastructure/packages |
| 9 | +[python-devcontainer](https://github.com/League-Examples/python-devcontainer/pkgs/container/python-devcontainer) |
0 commit comments