Run MySQL in Docker

Docker has changed how I approach software development under many aspects. One of them is how I install software dependencies on my developer's machine. I use Docker to install and configure my dependencies, usually required for testing my application.

Docker provides a tool for implementing a repeatable process for creating an isolated environment which has the expected configuration. A very common use case is represented by installing a database, such as MySQL or PostgresSQL, creating schemas and users, and populating tables.

Docker helps in automating our process and it can be combined easily with our CI/CD. We can easily run Docker as part of a Jenkins pipeline or we can run Docker with Apache Maven when building any Java or JVM based application.

Compile code with Docker

Every time I need to compile some code which I downloaded on the Internet, I have to spend a lot of time installing tools and libraries. Sometimes I need to cross-compile code or patch a library, and I need to configure some local environment which occupies space on my disk, but I can't throw away because I might need it again later.

What if I could easily and reliabily create the environment when I need?

Docker represents a versatile tool which can help to simplify and eliminate tedious operations such as preparing an environment for compiling code. This principle can be extended to any build process, and actually there are already companies such as CircleCI, which have adopted Docker for providing CI/CD solutions.