I hope I’m in the right place.
I would like to delete the environment variables set by docker-compose.
This is also possible via command line but not via script. Even if I had “sourced” the script (source ./myscript.sh)
I am using a modified alpine-image with mariadb.
A “run.sh” - Script is used as entrypoint. This script checks wether the DB is already set up properly or not. If not all necessary DBs are created. Therefore I submit some environment variables (such as DB-name, DB-user and DB-pass) via docker-compose.
So far so good, all works fine. But I would like to remove all these environment variables after DB-creation (or in case no creation was needed) for security reason. But nothing seems to work as suspected
- modified the “run.sh” entrypoint to ‘unset’ the variables … no success (because it runs in a child-process of bash)
- created a script that launched once at docker-boot (using supervisord) … no success
- even with ‘source /path/to/script.sh’ it doesn’t remove/unset any variables
So what else can I do to get those vars deleted?
Thanks in Advance