Question is about docker architecture and imo it’s an advanced question.
i have an application running in docker containers. For the sake of simplicity let’s assume there is only a postgresql image and a frontend image. they are linked together just fine and the application is work as intended.
I want to add database dump/restore functionality to the UI.
I’ve read how to dump restore a database running inside a Docker container there are plenty of online sources for that. There are basically two approaches (with volumes or with a data container) but both methods relies on the ability of running docker commands.
However i wonder how should i implement it if i plan to add a dump / restore BUTTON to the UI (aka inside the frontend container) which should have the functionality of being able to save data and give a dump file back to user and reload a data provided by the user via browser interface.
How could the frontend container execute such a function? (there are some very nasty hacks, like you have access to underlying docker commands from within a container (but i consider those security flaws which will be likely purged from upcoming iterations of docker) )
What would be the correct / most efficient approach to do such thing?