Skip to content

Latest commit

 

History

History
62 lines (35 loc) · 3.19 KB

Docker.md

File metadata and controls

62 lines (35 loc) · 3.19 KB

This Project run on Docker

Docker Development

This project runs on Docker!!! Amazing, right?!

It just not as portable as you might think. My main motivation for adding Docker support to this project was to play around with the Travis CI integration and continuous delivery using Docker Hub.

So, you want to use the Docker Image?

This will allow you to benefit from all the automation that has already been written for you AND have hardware-accelerated 3D Graphics by actually using a container that leverages the underlying GPU processing power!!!!

I am afraid there are some caveats, though:

  • You need to have an NVIDIA GPU (sorry about that)
  • You need to install nvidia-docker 2.0 (More information here)

You can't/won't use the Docker Image

If you can't use the Docker image, you will still benefit a lot from it:

  • You will have all the dependencies listed on the Dockerfile
  • You can follow the Dockerfile steps as a tutorial to build/test and run the application (infrastructure as code).

Below, I give a short explanation for the tag's convention used in the DockerHub repository. I was heavily biased by the pattern that Jenkins applied on their project (the lts naming is from there!).

lhcopetti/haskell-game:dev (Development Docker Image)

The ideal way for you to acquire this image is by pulling the lhcopetti/haskell-game from the Docker Hub. Although there is a very compelling script on this repository (buildDockerImage-dev.sh) you shouldn't have to build it yourself.

This image's goals are:

  • Provide the most barebones system wide configuration to build and run the application
  • The source code and built binaries will be installed in the repo directory and shared with the container using volumes.
  • The container is ephemeral, meaning everytime it will be created a new one. The state will be kept inside the user's directory (eg: compiled libraries in .stack-work directory).
  • Provide an extremely easy way to test, build and run the application while developing.

lhcopetti/haskell-game:lts(-X.X)? (Production Docker Image)

This is the best way to take the application for a test drive, provided of course, you have the mandatory requirements for running it. The current convention is to have two lines of production images:

  • lhcopetti/haskell-game:lts

This image points to the latest successful build done on the master branch

  • lhcopetti/haskell-game:lts-X.X

The 'X.X' stands for the version of the released application.

Wrapping it all together you get that for each release (commit on master branch), Travis CI will perform two actions on DockerHub:

  • Build a new production image and push it to the corresponding lts version (taken from the src/version.ver file)
  • Overwrite the current lhcopetti/haskell-game:lts image with the previous built one.

This image's goals are:

  • Be the most lightweight image that is still capable of running the application
  • Should be kept up to date with the latest release versions (Continuos Delivery)