Skip to content

Commit 4c68221

Browse files
committed
Split templates out further
1 parent e9cc603 commit 4c68221

File tree

5 files changed

+46
-40
lines changed

5 files changed

+46
-40
lines changed

readme_builder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"description",
88
"documentation",
99
"quick_start",
10+
"pull_containers",
11+
"copy_packages",
1012
"tags",
1113
"funding"
1214
]

templates/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ Within 30 minutes of a new release to {{ package }} on PyPI builds will kick off
2929

3030
Containers are rebuilt weekly in order to take on the security patches from upstream containers.
3131

32+
## How To
33+
34+
{{ pull_containers }}
35+
36+
{{ copy_packages }}
37+
3238
{{ quick_start }}
3339

3440
## Python Versions

templates/copy_packages.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### Copy Just the Packages
2+
{% set short_repository = repository.split("/")[1] -%}
3+
4+
It's also possible to copy just the Python packages themselves. This is particularly useful when you want to use the precompiled libraries from multiple containers.
5+
6+
```dockerfile
7+
FROM python:{{ python_versions|last }}
8+
9+
COPY --from=ghcr.io/{{ organization }}/{{ short_repository }}:py{{ python_versions|last }}-slim-LATEST /usr/local/lib/python{{ python_versions|last }}/site-packages/* /usr/local/lib/python{{ python_versions|last }}/site-packages/
10+
```

templates/pull_containers.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
### Full
2+
{% set short_repository = repository.split("/")[1] -%}
3+
4+
To pull the latest slim version:
5+
6+
```bash
7+
docker pull ghcr.io/{{ organization }}/{{ short_repository }}:py{{ python_versions|last }}-LATEST
8+
```
9+
10+
To include it in the dockerfile instead:
11+
12+
```dockerfile
13+
FROM ghcr.io/{{ organization }}/{{ short_repository }}:py{{ python_versions|last }}-LATEST
14+
```
15+
16+
### Slim
17+
18+
To pull the latest slim version:
19+
20+
```bash
21+
docker pull ghcr.io/{{ organization }}/{{ short_repository }}:py{{ python_versions|last }}-slim-LATEST
22+
```
23+
24+
To include it in the dockerfile instead:
25+
26+
```dockerfile
27+
FROM ghcr.io/{{ organization }}/{{ short_repository }}:py{{ python_versions|last }}-slim-LATEST
28+
```

templates/quick_start.md

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +0,0 @@
1-
## Quick Start
2-
{% set short_repository = repository.split("/")[1] -%}
3-
4-
### Full
5-
6-
To pull the latest slim version:
7-
8-
```bash
9-
docker pull ghcr.io/{{ organization }}/{{ short_repository }}:py{{ python_versions|last }}-LATEST
10-
```
11-
12-
To include it in the dockerfile instead:
13-
14-
```dockerfile
15-
FROM ghcr.io/{{ organization }}/{{ short_repository }}:py{{ python_versions|last }}-LATEST
16-
```
17-
18-
### Slim
19-
20-
To pull the latest slim version:
21-
22-
```bash
23-
docker pull ghcr.io/{{ organization }}/{{ short_repository }}:py{{ python_versions|last }}-slim-LATEST
24-
```
25-
26-
To include it in the dockerfile instead:
27-
28-
```dockerfile
29-
FROM ghcr.io/{{ organization }}/{{ short_repository }}:py{{ python_versions|last }}-slim-LATEST
30-
```
31-
32-
### Copy Just the Packages
33-
34-
It's also possible to copy just the Python packages themselves. This is particularly useful when you want to use the precompiled libraries from multiple containers.
35-
36-
```dockerfile
37-
FROM python:{{ python_versions|last }}
38-
39-
COPY --from=ghcr.io/{{ organization }}/{{ short_repository }}:py{{ python_versions|last }}-slim-LATEST /usr/local/lib/python{{ python_versions|last }}/site-packages/* /usr/local/lib/python{{ python_versions|last }}/site-packages/
40-
```

0 commit comments

Comments
 (0)