
Ask HN: How do you test your docker images/docker-compose deployments? - coaxial
When I&#x27;m writing docker services or docker images, I have to test it all manually and hope for the best.<p>But it&#x27;s tedious and error-prone. Ideally, I&#x27;d want to check that a specific file is there with specific contents, or that when launching a container I can access a specific URL, etc.<p>What do you use for CI testing of Docker images and Docker services? Is there a best practice for doing that?
======
janoszen
I would recommend following the Docker Cloud approach:
[https://docs.docker.com/docker-cloud/builds/automated-
testin...](https://docs.docker.com/docker-cloud/builds/automated-testing/)

It basically boils down to creating a docker-compose file for testing, and
then running tests in it. How you run those tests is pretty much dependent on
the type of service you run.

You may also want to institute health checks, either within Docker /
Kubernetes, or full service monitoring from the outside.

~~~
coaxial
Thank you, I'm looking for something free, it's for a side project.

~~~
janoszen
It's free if it's open source. You could also use the same approach and run
the test compose yaml file on your desktop/laptop, you don't need to use the
Docker cloud for that. You could also integrate the same mechanism with
Gitlab.

