Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker images versioning for Continuous Integration / Continuous Deployment

We're implementing our Continuous Integration and Continuous Delivery processes with the use of two well-known concepts: Linux binary packages and Docker images.

The most part of the work is already done: we take the code from GitLab repo, compile it and put into the deb packages stored in Aptly, then we create Docker images for the every service we have and push the images into the private Docker Registry server. Afterwards these images are rolled to the testing environment. Finally we start the services and perform the acceptance testing. This is a continuous process and it starts every time when someone pushes commits to origin/master.

enter image description here

What's still not clear is how to distinguish stable images stored in the Docker Registry?

We have to track the state of every image because we need to perform the periodical updates of stable sever. Obviously some releases (i.e. versions of images) will not pass the acceptance tests and must be marked as unusable and filtered out at the every next iteration of Continuous Delivery.

Seems like there's no default implementation of this feature:

  1. Default image repo/tag is a trivial plain string that cannot hold both version number, build date and QA marks.
  2. Labels (introduced in 1.6) could be a good starting point for a workaround, but we were not able to find the opportunity of relabeling the existing images (note that we need to update the image "metadata" taking into account the results of QA). There is no usable method of querying the image by the label values, but we probably can wrap the Docker API.

So what is the proper way of assigning the versions to the Docker Images? How the QA-related information can be stored? How can we "highlight" the stable image builds? What features of Jenkins CI could be used for reaching these purposes? Please share your experience.

UPD: after a while I had to start the discussion in Docker issue tracker. Probably someone will find it useful too.

like image 914
Vitaly Isaev Avatar asked Jun 12 '15 14:06

Vitaly Isaev


People also ask

Is Docker used for continuous deployment?

Docker has become an early adopter in Continuous Integration and Continuous Deployment. By leveraging the right integration with source code control mechanism such as GIT, Jenkins can initiate a build process each time a developer commits his code.

Is Docker used for CI CD?

If you run CI/CD with docker containers, you can call it CI/CD Docker. With the perfect application of the docker container or hub, you can improve the overall experience of CI/CD workflows without reaching its limit. The main focus of the CI/CD pipeline is to deliver and integrate changes continuously.

How do you use Docker in CI CD pipeline?

How to implement a CI/CD pipeline in the codebase using a CircleCI config file in the project. Building a Docker image. Pushing the Docker image to Docker Hub. Kicking off a deployment script which will run the application in Docker container on a Digital Ocean server.

Which Docker features are used to enable CD?

Here's what you'll need: An AWS Account with an EC2 instance configured to expose ports 22, 80 and 443 and an SSH key for CircleCI to use. Source code of Dockerized App hosted on GitHub. Docker Hub (or some other Docker image repository you can publish to)


1 Answers

Looks like your question is already answered in that discussion link however I would just note that at Bleacher Report we never pushed images to a docker hub (private or hosted) that didn't pass CI first.

  • Code pushed
  • CircleCI creates a tagged build
  • Tests run inside tagged container
  • If tests passed CircleCI pushes tagged container to a hub

Detailed explanation

like image 52
feelobot Avatar answered Oct 21 '22 05:10

feelobot