Skip to content

Commit 6a6ffd3

Browse files
committed
Add logic for NO_PKGCLEAN
1 parent 4f1d7ed commit 6a6ffd3

3 files changed

Lines changed: 64 additions & 5 deletions

File tree

‎.daemonless/config.yaml‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,82 @@ build:
66
default: true
77
args:
88
FREEBSD_RELEASE: "15.1"
9+
NO_PKGCLEAN: "1"
10+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
911
- tag: 15.1-3
1012
containerfile: Containerfile
1113
args:
1214
FREEBSD_RELEASE: "15.1"
1315
PYVER: "3"
16+
NO_PKGCLEAN: "1"
17+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
1418
- tag: 15.1-2
1519
containerfile: Containerfile
1620
args:
1721
FREEBSD_RELEASE: "15.1"
1822
PYVER: "2"
23+
NO_PKGCLEAN: "1"
24+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
1925
- tag: 15.1-27
2026
containerfile: Containerfile
2127
args:
2228
FREEBSD_RELEASE: "15.1"
2329
PYVER: "27"
30+
NO_PKGCLEAN: "1"
31+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
2432
- tag: 15.1-310
2533
containerfile: Containerfile
2634
args:
2735
FREEBSD_RELEASE: "15.1"
2836
PYVER: "310"
37+
NO_PKGCLEAN: "1"
38+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
2939
- tag: 15.1-311
3040
containerfile: Containerfile
3141
args:
3242
FREEBSD_RELEASE: "15.1"
3343
PYVER: "311"
44+
NO_PKGCLEAN: "1"
45+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
3446
- tag: 15.1-312
3547
containerfile: Containerfile
3648
args:
3749
FREEBSD_RELEASE: "15.1"
3850
PYVER: "312"
51+
NO_PKGCLEAN: "1"
52+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
3953
- tag: 15.1-313
4054
containerfile: Containerfile
4155
args:
4256
FREEBSD_RELEASE: "15.1"
4357
PYVER: "313"
58+
NO_PKGCLEAN: "1"
59+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
4460
- tag: 15.1-313t
4561
containerfile: Containerfile
4662
args:
4763
FREEBSD_RELEASE: "15.1"
4864
PYVER: "313t"
65+
NO_PKGCLEAN: "1"
66+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
4967
- tag: 15.1-314
5068
containerfile: Containerfile
5169
args:
5270
FREEBSD_RELEASE: "15.1"
5371
PYVER: "314"
72+
NO_PKGCLEAN: "1"
73+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
5474
- tag: 15.1-314t
5575
containerfile: Containerfile
5676
args:
5777
FREEBSD_RELEASE: "15.1"
5878
PYVER: "314t"
79+
NO_PKGCLEAN: "1"
80+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
5981
- tag: 15.1-315
6082
containerfile: Containerfile
6183
args:
6284
FREEBSD_RELEASE: "15.1"
63-
PYVER: "315"
85+
PYVER: "315"
86+
NO_PKGCLEAN: "1"
87+
cache_dirs: ["pkgcache0:/var/cache/pkg"]

‎Containerfile‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ARG FREEBSD_RELEASE
33
FROM ghcr.io/appjail-makejails/base:${FREEBSD_RELEASE}
44

55
ARG PYVER
6+
ARG NO_PKGCLEAN
67

78
LABEL org.opencontainers.image.title="Python" \
89
org.opencontainers.image.description="Python is an interpreted, interactive, object-oriented, open-source programming language" \
@@ -11,7 +12,12 @@ LABEL org.opencontainers.image.title="Python" \
1112
org.opencontainers.image.vendor="DtxdF" \
1213
org.opencontainers.image.authors="Jesús Daniel Colmenares Oviedo <dtxdf@disroot.org>"
1314

14-
RUN pkg update && \
15-
pkg install python${PYVER} && \
16-
pkg clean -a && \
17-
rm -rf /var/cache/pkg/* /var/db/pkg/repos/*
15+
RUN set -xe; \
16+
\
17+
pkg update; \
18+
pkg install -U python${PYVER}; \
19+
\
20+
if [ -z "${NO_PKGCLEAN}" ]; then \
21+
pkg clean -a; \
22+
rm -rf /var/cache/pkg/* /var/db/pkg/repos/*; \
23+
fi

‎README.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ Type "help", "copyright", "credits" or "license" for more information.
103103
* `python_from` (default: `ghcr.io/appjail-makejails/python`): Location of OCI image. See also [OCI Configuration](#oci-configuration).
104104
* `python_tag` (default: `latest`): OCI image tag. See also [OCI Configuration](#oci-configuration).
105105

106+
### Environment (OCI image)
107+
108+
* `PGID` (default: `1000`): Equivalent to `PUID` but for the Process Group ID.
109+
* `PUID` (default: `1000`): Process User ID for the container's main process, allowing you to match the owner of files written to mounted host volumes to your host system's user. Writable volumes are changed based on this environment variable.
110+
106111
## OCI Configuration
107112

108113
```yaml
@@ -114,61 +119,85 @@ build:
114119
default: true
115120
args:
116121
FREEBSD_RELEASE: "15.1"
122+
NO_PKGCLEAN: "1"
123+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
117124
- tag: 15.1-3
118125
containerfile: Containerfile
119126
args:
120127
FREEBSD_RELEASE: "15.1"
121128
PYVER: "3"
129+
NO_PKGCLEAN: "1"
130+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
122131
- tag: 15.1-2
123132
containerfile: Containerfile
124133
args:
125134
FREEBSD_RELEASE: "15.1"
126135
PYVER: "2"
136+
NO_PKGCLEAN: "1"
137+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
127138
- tag: 15.1-27
128139
containerfile: Containerfile
129140
args:
130141
FREEBSD_RELEASE: "15.1"
131142
PYVER: "27"
143+
NO_PKGCLEAN: "1"
144+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
132145
- tag: 15.1-310
133146
containerfile: Containerfile
134147
args:
135148
FREEBSD_RELEASE: "15.1"
136149
PYVER: "310"
150+
NO_PKGCLEAN: "1"
151+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
137152
- tag: 15.1-311
138153
containerfile: Containerfile
139154
args:
140155
FREEBSD_RELEASE: "15.1"
141156
PYVER: "311"
157+
NO_PKGCLEAN: "1"
158+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
142159
- tag: 15.1-312
143160
containerfile: Containerfile
144161
args:
145162
FREEBSD_RELEASE: "15.1"
146163
PYVER: "312"
164+
NO_PKGCLEAN: "1"
165+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
147166
- tag: 15.1-313
148167
containerfile: Containerfile
149168
args:
150169
FREEBSD_RELEASE: "15.1"
151170
PYVER: "313"
171+
NO_PKGCLEAN: "1"
172+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
152173
- tag: 15.1-313t
153174
containerfile: Containerfile
154175
args:
155176
FREEBSD_RELEASE: "15.1"
156177
PYVER: "313t"
178+
NO_PKGCLEAN: "1"
179+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
157180
- tag: 15.1-314
158181
containerfile: Containerfile
159182
args:
160183
FREEBSD_RELEASE: "15.1"
161184
PYVER: "314"
185+
NO_PKGCLEAN: "1"
186+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
162187
- tag: 15.1-314t
163188
containerfile: Containerfile
164189
args:
165190
FREEBSD_RELEASE: "15.1"
166191
PYVER: "314t"
192+
NO_PKGCLEAN: "1"
193+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
167194
- tag: 15.1-315
168195
containerfile: Containerfile
169196
args:
170197
FREEBSD_RELEASE: "15.1"
171198
PYVER: "315"
199+
NO_PKGCLEAN: "1"
200+
cache_dirs: ["pkgcache0:/var/cache/pkg"]
172201
```
173202
174203
## Notes

0 commit comments

Comments
 (0)