L
L
link72018-08-30 06:03:17
Jenkins
link7, 2018-08-30 06:03:17

How to versionize docker containers in jenkins?

Hello!
In our company, ci / cd is configured on jenkins. After pushing from gitlaba, the project goes to the docker container, unfolds there and you can already watch it ready in the browser.
But the developers asked me to create assembly versioning using the docker registry. They want to commit containers from each build to the docker registry (of course with some sort of identifying tag).
As a docker registry, I chose nexus repository manager. At this stage, I stopped, because I don’t know which direction to look, and I don’t even know which automation tools I should use ..
I think it’s at least not professional to do this with a bash script. build versioning builds of docker containers?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
chupasaurus, 2018-08-30
@chupasaurus

If you don't like bash scripts, switch to Teamcity and/or look for plugins that replace bash scripts.
Tools - build id in Jenkins, Docker, Nexus, brain, input device (one of each is enough).

docker tag image_id $registry_addr/$image_name:"$BUILD_NUMBER"
docker push $registry_addr/$image_name:"$BUILD_NUMBER"

In the case of using separate tags for different stages (for example, dev, preprod, prod), you need to download the image manifest from the repository and upload it back with a different tag ( SO ).

K
klepiku, 2018-08-30
@klepiku

similar topic
How to properly deploy with docker registry?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question