diff options
author | Iwan Aucamp <aucampia@gmail.com> | 2022-09-17 22:25:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-17 22:25:53 +0200 |
commit | 3a418218d6bcdb46f78342e14c024063e2f53e71 (patch) | |
tree | 9d27340768361a2f125527124b1d6de1e4aea0a6 /docker | |
parent | 91e9842cf7e49d509096adc4abfb748d181fd956 (diff) | |
download | rdflib-3a418218d6bcdb46f78342e14c024063e2f53e71.tar.gz |
build: docker images for latest release and main branch (#2116)
This PR adds docker image building to the github actions workflow.
Two images are built:
- unstable: This is built from the current branch
- latest: This is built from the version of rdflib in
`docker/latest/requirements.txt`, but as this will be updated by
dependabot it will essentially always be the latest version.
The resulting image references are:
- `ghcr.io/rdflib/rdflib:unstable`
- `ghcr.io/rdflib/rdflib:latest` with an alias
`ghcr.io/rdflib/rdflib:${rdflib_version}`, e.g.
`ghcr.io/rdflib/rdflib:6.2.0`.
As dependabot is conifgured for both pyton and docker dependencies, any
change/update to dependencies will result in a new image being built.
To avoid spurious changes in image digests the existing image is used as
the cache source, so if the requirements.txt and Dockerfile for
`ghcr.io/rdflib/rdflib:latest` has not changed then a new image should
not be published for it even if the build runs.
I have tested this in my forked repo, but there may be some kinks to
still work out.
Diffstat (limited to 'docker')
-rw-r--r-- | docker/latest/Dockerfile | 9 | ||||
-rw-r--r-- | docker/latest/requirements.in | 2 | ||||
-rw-r--r-- | docker/latest/requirements.txt | 22 | ||||
-rw-r--r-- | docker/unstable/Dockerfile | 14 | ||||
-rw-r--r-- | docker/unstable/requirements.txt | 19 |
5 files changed, 66 insertions, 0 deletions
diff --git a/docker/latest/Dockerfile b/docker/latest/Dockerfile new file mode 100644 index 00000000..f5ecc9f8 --- /dev/null +++ b/docker/latest/Dockerfile @@ -0,0 +1,9 @@ +FROM docker.io/library/python:3.10-slim@sha256:c212a18a48efd4de1d6455f197538563d9cc312775761f14c50866c9a7eabd0e + +COPY docker/latest/requirements.txt /var/tmp/build/ + +RUN \ + pip install --no-deps -r /var/tmp/build/requirements.txt && \ + rdfpipe --version + +ENTRYPOINT [ ] diff --git a/docker/latest/requirements.in b/docker/latest/requirements.in new file mode 100644 index 00000000..c704360a --- /dev/null +++ b/docker/latest/requirements.in @@ -0,0 +1,2 @@ +rdflib==6.2.0 +html5lib diff --git a/docker/latest/requirements.txt b/docker/latest/requirements.txt new file mode 100644 index 00000000..541b7580 --- /dev/null +++ b/docker/latest/requirements.txt @@ -0,0 +1,22 @@ +# +# This file is autogenerated by pip-compile with python 3.10 +# To update, run: +# +# pip-compile docker/latest/requirements.in +# +html5lib==1.1 + # via -r docker/latest/requirements.in +isodate==0.6.1 + # via rdflib +pyparsing==3.0.9 + # via rdflib +rdflib==6.2.0 + # via -r docker/latest/requirements.in +six==1.16.0 + # via html5lib +webencodings==0.5.1 + # via html5lib + +# The following packages are considered to be unsafe in a requirements file: +# setuptools + diff --git a/docker/unstable/Dockerfile b/docker/unstable/Dockerfile new file mode 100644 index 00000000..2bba3f6b --- /dev/null +++ b/docker/unstable/Dockerfile @@ -0,0 +1,14 @@ +FROM docker.io/library/python:3.10-slim@sha256:c212a18a48efd4de1d6455f197538563d9cc312775761f14c50866c9a7eabd0e + +COPY docker/unstable/requirements.txt /var/tmp/build/ + +RUN \ + pip install -r /var/tmp/build/requirements.txt + +COPY dist/*.whl /var/tmp/build/ + +RUN \ + pip install --no-deps /var/tmp/build/*.whl && \ + rdfpipe --version + +ENTRYPOINT [ ] diff --git a/docker/unstable/requirements.txt b/docker/unstable/requirements.txt new file mode 100644 index 00000000..529eead7 --- /dev/null +++ b/docker/unstable/requirements.txt @@ -0,0 +1,19 @@ +# +# This file is autogenerated by pip-compile with python 3.10 +# To update, run: +# +# pip-compile --output-file=docker/unstable/requirements.txt requirements.txt +# +html5lib==1.1 + # via -r requirements.txt +isodate==0.6.1 + # via -r requirements.txt +pyparsing==3.0.9 + # via -r requirements.txt +six==1.16.0 + # via + # html5lib + # isodate +webencodings==0.5.1 + # via html5lib + |