I have a customized image built from a public IBM Db2 image which has an entrypoint doing initializations. To create more than 1 database at startup, I wrote my own init.sh and put it in CMD clause. The COMMAND in 'docker ps' are like:
/var/db2_setup/lib/setup_db2_instance.sh /bin/sh -c /init.sh
The init.sh is
#!/bin/sh
su - db2inst1 << EOF
export PATH=$PATH:/opt/ibm/db2/V11.1/bin
db2 create database DB1
db2 create database DB2
db2 create database DB3
EOF
As I know, the following "/bin/sh -c /init.sh" should be ignored since I checked setup_db2_instance.sh file where there are no codes dealing with param like /bin/sh.
But db2 is successfully initialized and the three DBs are created. Have anyone encountered this or have any reference explaining why this happen?