Minke is an opinionated build system for μServices and Docker, it uses generator templates to create working source code, Dockerfiles, and anything else you may need to build and deploy a working microservice.
The intention is to produce a 0 dependency standardised build and test framework that works equally well on CI as it does on your local machine.
You have two options keep reading and see just how quick you can build a microservice with Minke, I promise it will be less than 5 minutes. Or watch my talk from ContainerShed in 2016 where I demonstrate Minke live on stage, this talk also explains my ethos towards continuous delivery.
Minke uses Docker
If you don’t have it …
If you are using Docker Toolbox for Mac you will need to set your DOCKER_HOST environment variable, this is quite simple just execute the below command. The Linux install and Docker for Mac should not require this.
$ eval $(docker-machine env default)
Like make on steroids
Minke is almost a 0 dependency setup for building your source code you will need three things.
- A computer, Mac or Linux (Windows too if someone would like to write a .bat script).
Minke just deals with the other stuff; Minke and it’s generators are built in Ruby however you do not need Ruby installed as the build scripts run in a Docker container. The commands to build and test the application are built into the generator along with any application specific logic so the interface to the user is one of a few key simple commands.
fetch # fetch dependent packages test # run unit tests build # build application build_image # build Docker image for application build_and_run # bonus points for guessing run # run application with Docker Compose cucumber[feature] # run end to end Cucumber tests USAGE: rake app:cucumber[@tag] shell # runs the application stack with docker compose and starts a shell session in the build container
It is completely extensible, for example you are building a Microservice and would like to automatically setup the database schema or load some initial data. This can easily be achieved by writing your own Rake tasks.
The core concept of Minke is that it should be possible to run two Minke builds on the same machine with no port or container conflicts. For this reason Minke automatically creates a Docker network and gives unique names to the containers to avoid conflict. To avoid the need for exposing public ports for setup or functional testing Minke has service discovery built in you can simply use the discovery API to resolve any containers address.
Minke can encrypt config variables with a private key so you don’t have to expose your passwords to the whole internet.
The table below shows the currently available generators, to create your own please follow the creating generators guide.
|Go||Go μService Template|
|.NET Core||.NET MVC|
|Swift 3.0||IBM Kitura|
|Node||ExpressJS (Coming Soon)|
|Ruby||Rails (Coming Soon)|
Scaffold a new service
- Create the folder where you would like the new service and change into that directory. Whilst we are building a Go microservice in this example you do not need to create this folder in your GOPATH if you are only going to build with Minke as the generator uses the new vendoring capability introduced in Go 1.5.
$ mkdir ~/myservice $ cd ~/myservice
- Run the generator command in a docker container. (note the space before -g)
$ curl -Ls https://get.minke.rocks | bash -s 'generate -g minke-generator-go -o $(pwd) -n github.com/nicholasjackson -a myservice'
- Build a Docker image
$ cd _minke $ ./minke -v build_image
The -v flag tells minke to output the verbose logs, if you omit this then you will see a much cleaner output.
- Execute the functional tests
$ ./minke -v cucumber
You now have a working microservice ready to be pushed to a Docker registry and deployed to a server. For more detailed information please see the tutorial.