This repository holds the Dockerfile code to generate rever python images
To add a new image:
-
Create a new folder with the name of the tag that the image will have (if the image tag will have . replace those with - in the name of the folder).
-
Add the Dockerfile in the folder you just created.
-
Update the file
job__docker_build_image_python.groovyin the jenkins-dsl repository:update the cd instruction (line 45 as the time of writing) and set it to the name of the folder you created in step 1
update the docker buildx build instruction (line 46 as the time of writing), change the tag after
${IMAGE_NAME}:to the tag of your new image. -
Make sure to push the jenkins-dsl first and make sure the dsl--jobs runs without issues.
-
Push the changes from this repository, the job
docker-build-image--rever-pythonshould start to run in jenkins, if the job passes then the image should be uploaded to Docker hub. You may run the job manually if needed.
Example
- I need to add a python 3.9-debian image, so in this repository I create the folder
3-9-debian. - Inside
3-9-debianI would add the Dockerfile that will generate the image. I test it locally to make sure it works. - I would update line 45 and line 46 in
job__docker_build_image_python.groovyfile in jenkins-dsl repository to add the folder and image tag, the lines look like:cd 3-9-debian docker buildx build --platform ${PLATFORMS_TO_BUILD} -t ${IMAGE_NAME}:3.9-debian --push .
- I would push the changes in jenkins-dsl repository and make sure that dsl--jobs finishes.
- I would pish this repository changes and monitor the
docker-build-image--rever-pythonjob, if it passes my image should be available to pull from our rever repository, ierever/python:3.9-debian