Open julianGoh17 opened 4 years ago
A quick google has revealed a few things that should be taken in to consideration when developing the container handler.
As suspected, since there is a docker CLI there must be a docker API that the CLI will interact with. Current thinking is that the API is what is used by the machine to manage the containers and the CLI just interacts with the exposed endpoints on the API to tell the machine to start/stop docker containers. There is evidence this is true from the fact that the docker CLI GitHub Repo uses the same Docker SDK
Because the simple-e2e binary is already hosted in a container (to make it deployable in any environment), we should not be spinning up containers in the simple-e2e container. Instead we should be mounting a docker socket on to the system so that we avoid docker in docker (this will solve alot of problems such as building containers and over bloating the simple-e2e container)
To allow for the spun up containers to interact with one another, we should use docker networking. This will give a domain name to a container for another container to interact with.
Note: A good example of the docker SDK
Add a handler for the container which will allow us to get the state of the container and check the logs of the container. The handler should also log when things are going wrong in the container (such as when errors occurs).
A number of features need to be added to complete this issue: