The container that obliges good development practices with Docker containers
Support testing Dockerfiles (static code analysis), Images (unit tests), Containers (functional tests) - mostly using Ruby / RSpec plus Dockerlint
To test this container using this container:
docker-compose up
To build ... have anothet compose file?
Clone the repository
- Update the Dockerfile to be your Dockerfile
- Run docker-compose up, it will probably fail
- Update the image_spec.rb this is your unit testing - don't add tests that need the container to be running
- Update the container_spec.rb this is your runtime functional testing
- If your container does work and then stops, ...
- If your container runs as a daemon, ...
A lot of inspiration came from here [http://www.unixdaemon.net/tools/testing-dockerfiles-with-serverspec/]
Blog Wanted a simple re-usable way to test containers Meaning static, unit, runtime How to make it work How to re-use What is really happening