Use a single docker image for all sandbox components as an alternative to the current docker-compose structure
Problem
The problem with the current Docker Compose structure of the Sandbox occurs when there is necessity to execute the sandbox inside a Docker environment if DinD (Docker-in-Docker) is not available.
For example, Gitlab.com CI/CD allows executions of pipeline code inside a given Docker image, and doesn't allow Docker-in-Docker images. Using a single image that exposes all the components and can be uploaded to a repository, it would be possible to extend it (i.e. using apk if based on Alpine Linux) and prepare it for Test execution.
Solution
Prepare a single Dockerfile that merges all the components (postgres DB, indexer and algod) in one single image.
This image would be usable with standard docker build and docker run <image_name> command.
The solution could be implemented without impacts on the current structure, just as a separate component and not as a substitution of the current one. Current working software that uses the current Sandbox structure would not be affected.
Dependencies
None
Urgency
Not urgent, but useful in an ongoing project.
Yes, I pretty much support this.
It would be great to have everything in a single docker container. 👍
It would be great for testing.
Thanks for the feedback everyone. I can honestly say that this use case never occurred to us. I don't know if we'd support this in sandbox, but maybe it's worth supporting directly.
Could I ask a follow-up question: What endpoints are you using for tests? What features would be most useful for testing? When used, would you still call "sandbox" or would you extend the unified docker container to include your test environment?
Hi @winder , these are the answers:
What endpoints are you using for tests?
We're using almost all endpoints on algod and /v2/accounts, /v2/transactions on indexer.
What features would be most useful for testing?
It would be useful to have algod and indexer preferably inside an extendible docker image (i.e. one based on Alpine with apk or Ubuntu with apt-get). We don't use kdm at the moment.
When used, would you still call "sandbox" or would you extend the unified docker container to include your test environment?
We would extend the docker to include the test environment. For example, in case of npm project, if the name of the unified image is sandbox, we would use:
FROM sandbox
apk add nodejs npm
Thank you!
Having access to kmd so you can programmatically get hold of the default wallet is handy too.