I want to copy the my.cnf file present in the host server to child docker image wherever I run docker file that uses a custom base image having below command.
ONBUILD ADD locate -i my.cnf|grep -ioh 'my.cnf'|head -1 /
but above line is breaking docker file. Please share correct syntax or alternatives to achieve the same.
Unfortunately, you can't declare host commands inside your
Dockerfile. See Execute command on host during docker build .Your best bet is probably to tweak your deployment scripts to locate
my.cnfon the host before runningdocker build.