I am in a similar pair of shoes as you - I am currently, slowly, getting into the DevOps topics after having many, many years of conventional development (and close connections to conventional ops) behind me.
You seem to have read a few articles, or heard a few things. That is good. Let me suggest a practical approach how to go on:
- Take your favourite application (which you or your team wrote yourself); not too large, preferably with a limited amount of services (like Apache, DB etc.) working together with your app.
docker, read a bit on the Dockerfile and the whole build process, and just go ahead to create one or more Dockerfiles for that application. You know already how to deploy it manually; now make it run inside a container.
- Make it easy on yourself. Use a
FROMparent container that is a full-blown distribution of your choice. I like
debian:jessie, but you can pick whichever you are familiar with.
- At the start, do not worry about image sizes. This is just a pet project. Start your Dockerfile with the
FROM, then as many
apt-get update; apt-get install ... as you need to get your application running. Add stuff with
- Learn how to actually run those containers; how
EXPOSEworks, how to
--linkthe app together with the DB and the Apache (in case you made a separate container for that - you can skip this obviously if your app is able to serve all stuff including static pages itself). Figure out how to mount/bind
volumes, how to debug a container by opening a shell inside it and so on.
docker-compose is nice if you have more than one, and pretty simple to get going with.
- Now you probably have a working setup. That's great! You have learned the basics, and you immediately feel the great power that comes from containerizing your app. You can deploy it instantly on any server, you can give it to your developer colleagues and go up and running in zero time, and so on. Enjoy that feeling for a while.
- Make the image smaller. There are a few obvious things you can do (google...), and a few not so obvious ones (thinking is like googling, just better... :) ). If you need help on that, post more questions here.
- Get Jenkins (feel free to do so with docker, again, if you're adventurous) and make a job to build the image from the Dockerfile and run your test suite directly in the container you built. Jenkins can check your repository for updates automatically, you don't need to bother with
git hooks at this moment.
- You're done! This was the CI part. For CD, after the tests are green in Jenkins, simply tag the build and send it on to your deployment server.
This should take you, if you are an experienced developer and have done these things "dry" already, not much longer than a few days. Docker itself is a pretty simple affair, there is not much more to it. One further part that makes sense to add to the puzzle is Ansible, which makes it pretty easy to manage another machine remotely (i.e. for installing packages, deploying stuff, starting services and whatnot).
If you have Docker and Ansible down, just get your CI/CD pipeline to work. Google advanced, but necessary stuff like security and such. After that, you should be experienced enough to decide in which direction to go next (i.e., larger stuff like Openshift/Kubernetes, or just whatever AWS/Azure or whatever have to offer, etc.). There are a myriad of different options out there, and much of the choice seems to be pretty opinion-based. If you get into High Availability, swarms and such, it will also pretty soon get more non-trivial. But starting out with Docker should be fun and relatively straightforward.