Skip to content

Commit 42c00af

Browse files
authored
refactor(3.12): pass silent flag to make command (#5)
1 parent eb31898 commit 42c00af

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

3.12/bookworm/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ RUN set -eux; \
5353
nproc="$(nproc)"; \
5454
EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \
5555
LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \
56-
make -j "$nproc" \
56+
maske -s -j "$nproc" \
5757
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
5858
"LDFLAGS=${LDFLAGS:-}" \
5959
"PROFILE_TASK=${PROFILE_TASK:-}" \
6060
; \
6161
# https://github.com/docker-library/python/issues/784
6262
# prevent accidental usage of a system installed libpython of the same version
6363
rm python; \
64-
make -j "$nproc" \
64+
maske -s -j "$nproc" \
6565
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
6666
"LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \
6767
"PROFILE_TASK=${PROFILE_TASK:-}" \

3.12/slim-bookworm/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ RUN set -eux; \
8181
EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \
8282
LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \
8383
LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \
84-
make -j "$nproc" \
84+
maske -s -j "$nproc" \
8585
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
8686
"LDFLAGS=${LDFLAGS:-}" \
8787
"PROFILE_TASK=${PROFILE_TASK:-}" \
8888
; \
8989
# https://github.com/docker-library/python/issues/784
9090
# prevent accidental usage of a system installed libpython of the same version
9191
rm python; \
92-
make -j "$nproc" \
92+
maske -s -j "$nproc" \
9393
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
9494
"LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \
9595
"PROFILE_TASK=${PROFILE_TASK:-}" \

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@
1919

2020
### Create a `Dockerfile` in your Python app project
2121

22+
```dockerfile
23+
FROM coatldev/python:3
24+
25+
WORKDIR /usr/src/app
26+
27+
COPY requirements.txt ./
28+
RUN pip install --no-cache-dir -r requirements.txt
29+
30+
COPY . .
31+
32+
CMD [ "python", "./your-daemon-or-script.py" ]
33+
```
34+
35+
or (if you need to use Python 2):
36+
2237
```dockerfile
2338
FROM coatldev/python:2
2439

@@ -32,14 +47,21 @@ COPY . .
3247
CMD [ "python", "./your-daemon-or-script.py" ]
3348
```
3449

50+
You can then build and run the Docker image:
51+
52+
```sh
53+
docker build -t my-python-app .
54+
docker run -it --rm --name my-running-app my-python-app
55+
```
56+
3557
### Run a single Python script
3658

3759
For many simple, single file projects, you may find it inconvenient to write a
3860
complete `Dockerfile`. In such cases, you can run a Python script by using the
3961
Python Docker image directly:
4062

4163
```sh
42-
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:3 python your-daemon-or-script.py
64+
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp coatldev/python:3 python your-daemon-or-script.py
4365
```
4466

4567
or (again, if you need to use Python 2):

0 commit comments

Comments
 (0)