If you’re looking to dockerize a configuration file or script. you may want to look into volumes and configs. Both have their advantages and disadvantages, depending on what you’re trying to do with the script. Have a look at the docs I linked to, and you can make your own decision as to which is most appropriate.
Exactly. I have a sql file dump for which i am planning to create a docker image. So when anyone pulls that image, he should get the database and data content imported into his local machine.
Thanks for the reply. Now I am able to create a docker image for my sql script and able to execute it as well. My another requirement is like apart from this image, i have another image of a DDL script which should be executed after image i have created. Is there any way which can be done in a single yml or a docker file?
Both the sql’s will be pointing to same db, port.so i would like to execute on same container.
Depends on how your script works.
If you have 2 images, and you need to have the database up BEFORE you execute the script container, you can checkout https://docs.docker.com/compose/startup-order/
But if its a simple script (depending on what it does) you can add it to the database image
I am using SAP HANA.So I want to create a database image/container, where the my data file is imported, so when a guy pulls the image, the guy will have a database with content.