rdf4j
rdf4j copied to clipboard
Document step-by-step procedure for creating docker images and publishing them as part of release
The process to create docker images for different architectures and to publish them to dockerhub as part of the release process is poorly documented. As a result we tend to forget to do this.
- [ ] the build script in src/main/dist/docker currently fails
- [ ] there are no clear instructions on how to build images for both amd and arm architectures
- [ ] there are no clear instructions on how to set both version tag and 'latest' tag and publish the images to dockerhub
- [ ] there should be a reminder as part of the release process/script somewhere to take care of this
Yeah, I'll have to update and improve the outdated docs on https://rdf4j.org/documentation/developer/releases/#optional-publishing-docker-images
Oh, I hadn't even seen that! I was looking at the Readme.dev in assembly/src/dist/docker
. We should perhaps remove that or at least link them.
Hmz yes, some cleanup is needed :-) And perhaps having (another) look at the procedure since support for multiple platforms is easier / more common than it used to be
Modern approach to do multi-arch builds: https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide and https://www.docker.com/blog/multi-platform-docker-builds/
So instead of manually creating separate tags per architecture, this can "now" (well, since quite a while) be handled automatically by docker / hub.docker itself.
So one can just go to the directory containing the Dockerfile and do
docker buildx build --platform=linux/amd64,linux/arm64 .
This requires that the base image being used is available for these platforms, but for RDF4J this should not be a problem (basic tomcat image is available for amd64 and arm64)
What also can be handled in 1 single Dockerfile (instead of requiring a shell script) is building the project in a "first stage" (either do a complete build via mvn, or just download the zip from the rdf4j website) , then copying the result to the second stage using COPY --from
For automation, this action might be useful: https://github.com/docker/build-push-action
I think this one can be closed, see also #4243