I would like to run a script inside docker contaier.
Im using Ubuntu 18.04 and docker 19.03.8, there is a file I made with this content:
script.sh docker exec -it postgres-12.2 psql -U postgres && \ l
It only run the first command. The “\ l” is to list the databases but actually I’m going to use other commands instead. The “\ l” is just to simplify the situation, the example.
This command would be executed when I needed it and not just when the container go up.
The “\ l” was just an example. I must replace it later with other n commands.
I tried this too but it didn’t work:
This will help me to make several tasks more automated when using Docker.
I need it to be calling a file (.sh).