简体   繁体   中英

Jenkins + Docker

I would like to create a continous integration Workflow using Jenkins + BitBucket + Docker + Python.

Here are all steps that I imagine:

  1. The user push app python code with tests unit and a Dockerfile.
  2. BitBucket hook a job on jenkins
  3. Jenkins clone the repository.
  4. Jenkins build the Dockerfile.
  5. Jenkins run the docker image executing test cases. My test case are dockerized.
  6. If all tests pass, Jenkins push the image to Docker Hub.

Is it a right/good approach?
Does anyone has experience doing this? Does anyone has links / docs to help me?

It is a very good approach. You did already answer your own question. So it's clear for you that this is an approach which Docker supports.

A hint: When you also want to host your application (perhaps at a later stage), than it's recommended to use OpenShift V3 of Red Hat Docu .

This platform is also working with Docker. It's possible to run Jenkins in a Docker container. You can configure this Jenkins to perform build-test-deploy of your own application. Your application will be deployed in another Docker container. It's possible to use webhooks, scale your application and ensure High Availability of it.

Using Jenkins with Python and Git on Docker

This was a problem I faced and I thought I'd try to solve it robustly. Jenkins is great but when you want to move it to another system you realize how much baggage you created by installing one service after the other that it relies on. To decouple this with Docker is a great choice but the barebones one that Jenkins makes is just that, very barebones.

Dockerfile

My article explaining the dockerfile as well as how to use or extend it

I mention how to extend it near the end but the explicit solution would be to change the line I mentioned from:

ENV BASE_APKS="sudo openssl openssh-client zip ttf-dejavu maven ruby" \ 

to

ENV BASE_APKS="sudo openssl openssh-client zip ttf-dejavu maven ruby python" \ 

And then rebuild using

docker build -t mycompany/jenkins .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM