Skip to content

Commit 9953209

Browse files
committed
Add uv docs
1 parent a831771 commit 9953209

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

.github/workflows/docker-image.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@ name: Docker Image CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88
schedule:
99
- cron: "0 18 * * FRI"
1010
- cron: "0 18 * * WED"
1111

1212
jobs:
13-
1413
base:
15-
1614
runs-on: ubuntu-latest
1715

1816
strategy:
@@ -114,7 +112,6 @@ jobs:
114112
shm-size: 4G
115113
tags: ghcr.io/snakepacker/python/${{ matrix.image.tag }},ghcr.io/snakepacker/python:${{ matrix.image.tag }},snakepacker/python:${{ matrix.image.tag }}
116114

117-
118115
images-pillow:
119116
needs: images
120117
runs-on: ubuntu-latest
@@ -172,7 +169,6 @@ jobs:
172169
shm-size: 4G
173170
tags: ghcr.io/snakepacker/python/${{ matrix.image.tag }},ghcr.io/snakepacker/python:${{ matrix.image.tag }},snakepacker/python:${{ matrix.image.tag }}
174171

175-
176172
apps:
177173
needs:
178174
- images
@@ -198,6 +194,8 @@ jobs:
198194
tag: gray
199195
- context: ruff
200196
tag: ruff
197+
- context: uv
198+
tag: uv
201199
- context: jupyterlab
202200
tag: jupyterlab
203201

README.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ This project is available both in the official docker repository and also on the
3636
[`ghcr.io/snakepacker/python/black`](https://github.com/orgs/snakepacker/packages/container/package/python%2Fblack) | [`snakepacker/python:black`](https://hub.docker.com/r/snakepacker/python/tags?page=1&name=black)
3737
[`ghcr.io/snakepacker/python/gray`](https://github.com/orgs/snakepacker/packages/container/package/python%2Fgray) | [`snakepacker/python:gray`](https://hub.docker.com/r/snakepacker/python/tags?page=1&name=gray)
3838
[`ghcr.io/snakepacker/python/ruff`](https://github.com/orgs/snakepacker/packages/container/package/python%2Fruff) | [`snakepacker/python:ruff`](https://hub.docker.com/r/snakepacker/python/tags?page=1&name=ruff)
39+
[`ghcr.io/snakepacker/python/uv`](https://github.com/orgs/snakepacker/packages/container/package/python%2Fuv) | [`snakepacker/python:uv`](https://hub.docker.com/r/snakepacker/python/tags?page=1&name=uv)
3940
[`ghcr.io/snakepacker/python/jupyterlab`](https://github.com/orgs/snakepacker/packages/container/package/python%2Fjupyterlab) | [`snakepacker/python:jupyterlab`](https://hub.docker.com/r/snakepacker/python/tags?page=1&name=jupyterlab)
4041
[`ghcr.io/snakepacker/python/base`](https://github.com/orgs/snakepacker/packages/container/package/python%2Fbase) | [`snakepacker/python:base`](https://hub.docker.com/r/snakepacker/python/tags?page=1&name=base)
4142

@@ -68,52 +69,53 @@ all-pillow | ![](https://flat.badgen.net/docker/size/snakepacker/python/all-pill
6869
[black](https://black.readthedocs.io/en/stable/) | ![](https://flat.badgen.net/docker/size/snakepacker/python/black/amd64?label=size) | ready to use | black application image (useful for CI)
6970
[gray](https://github.com/dizballanze/gray) | ![](https://flat.badgen.net/docker/size/snakepacker/python/gray/amd64?label=size) | ready to use | gray application image (useful for CI)
7071
[ruff](https://github.com/astral-sh/ruff) | ![](https://flat.badgen.net/docker/size/snakepacker/python/ruff/amd64?label=size) | ready to use | ruff linter image (useful for CI)
72+
[uv](https://github.com/astral-sh/uv) | ![](https://flat.badgen.net/docker/size/snakepacker/python/uv/amd64?label=size) | ready to use | An extremely fast Python package and project manager (useful for CI)
7173
[jupyterlab](https://github.com/jupyterlab/jupyterlab) | ![](https://flat.badgen.net/docker/size/snakepacker/python/jupyterlab/amd64?label=size) | ready to use | jupyterlab image
7274
base | ![](https://flat.badgen.net/docker/size/snakepacker/python/base/amd64?label=size) | | common layers
7375

7476

7577
Concept
7678
-------
7779

78-
The main idea of this method is to build a `virtualenv` for your package using
79-
heavy full-powered image (e.g. `ghcr.io/snakepacker/python:all`, that contains all
80-
necessary headers, libraries, compiler, etc.), and then copy it into thin
80+
The main idea of this method is to build a `virtualenv` for your package using
81+
heavy full-powered image (e.g. `ghcr.io/snakepacker/python:all`, that contains all
82+
necessary headers, libraries, compiler, etc.), and then copy it into thin
8183
`base image` with suitable Python version.
8284

8385
Reasons
8486
-------
8587

86-
Why so complex? You could just `COPY` directory with your python project into
87-
Docker container, and for the first point of view this seems to be reasonable.
88+
Why so complex? You could just `COPY` directory with your python project into
89+
Docker container, and for the first point of view this seems to be reasonable.
8890

8991
But just copying directory with python project cause several problems:
9092

91-
- Generated on different operating system .pyc files can be put into Docker
92-
image accidentally. Thus, python would try to rewrite .pyc with correct ones
93-
each time when Docker image would be started. If you would run Docker image
94-
in read-only mode - your application would break.
95-
96-
- Large possibility that you would also pack garbage files: pytest and tox
97-
cache, developer's virtualenv and other files, that just increate the size of
93+
- Generated on different operating system .pyc files can be put into Docker
94+
image accidentally. Thus, python would try to rewrite .pyc with correct ones
95+
each time when Docker image would be started. If you would run Docker image
96+
in read-only mode - your application would break.
97+
98+
- Large possibility that you would also pack garbage files: pytest and tox
99+
cache, developer's virtualenv and other files, that just increate the size of
98100
the resulting image.
99101

100-
- No explicit entrypoint. It is not obvious what commands end user is able to
102+
- No explicit entrypoint. It is not obvious what commands end user is able to
101103
run (we hope you've implemented `-h` or `--help` arguments).
102-
103-
- By default, tox interprets your package as python module, e.g. it tries to
104+
105+
- By default, tox interprets your package as python module, e.g. it tries to
104106
run `pip install .` when preparing environment.
105107

106108
Yes, of course, you can solve all of those problems using hacks, specific
107-
settings, .dockeridnore file, and other tricks. But it would be non-intuitive
109+
settings, .dockeridnore file, and other tricks. But it would be non-intuitive
108110
and non-obvious for your users.
109111

110-
So, we recommend to spend a little more time and pack your package carefully,
112+
So, we recommend to spend a little more time and pack your package carefully,
111113
so your users would run it with pleasure.
112114

113115
Example
114116
-------
115117

116-
For example, you may build the `jupyter notebook`. Just create a Dockerfile
118+
For example, you may build the `jupyter notebook`. Just create a Dockerfile
117119
with the following content:
118120

119121
```Dockerfile
@@ -168,7 +170,7 @@ All images contain ready to use and simple wrappers for easy image building.
168170

169171
Pretty simple bash script. The main purpose is removing the apt cache and temporary files after installation when you want to install something through apt-get install.
170172

171-
Otherwise, you have to write something like this
173+
Otherwise, you have to write something like this
172174

173175
```bash
174176
apt-get update && \

0 commit comments

Comments
 (0)