Create a Python-friendly GoCD Agent in Docker

Posted by in IT, Tutorial

I’ve got two requirements to make GoCD useful:

  1. Run both the server and agent(s) in Docker
  2. Make it python-friendly

Fortunately, GoCD offers Docker images (and Dockerfiles) for both, so it’s just a matter of extending it:

Unfortunately, pip is not quite adequate, so we re-install it from source. In the Dockerfile we add:

Now we have a fully functional Docker file capable of building python applications and we can actually build the image. In the directory where we have the Dockerfile, execute:

Then, you can run it with:

I’m using 192.168.99.100:8154 because I’m running on my local machine for testing. You’ll probably need to replace the address.

Note: If you’re behind proxy, you can use my docker_build and docker_run aliases.

Full DockerFile

The full Dockerfile is:

HTH,


A little experiment: If you find this post and ad below useful, please check the ad out :-)