Docker Community Forums

Share and learn in the Docker community.

ONBUILD not run


(Rafaelri) #1

Hi all,

I am not sure whether I misunderstood ONBUILD usage on a docker machine but I’ve forked a docker image for oracle-xe and I am trying to improve it. I thought I could use ONBUILD to trigger oracle configuration upon image usage but after succesfulling creating my image and trying to run it either from docker-compose or directly with docker run the entrypoint is called immediately without the ONBUILD instruction that is on the parent image being run. Am I missing something here?
Here is the link for my [docker-oracle-xe-11g fork] (https://github.com/rafaelri/docker-oracle-xe-11g/blob/master/Dockerfile).
I tried running it directly with docker run rafaelri/docker-oracle-xe-11g:latest and with docker-compose and the following docker-compose.yml file but both resulted in the docker-entrypoint.sh being called directly before my ONBUILD RUN instruction from the parent image was called.
docker-compose.yml
oracle: image: rafaelri/docker-oracle-xe-11g
What am I missing here in order to have the ONBUILD RUN to get run before the entrypoint?

Best regards,
Rafael


(Rafaelri) #2

Just figured out by myself. Running does not trigger a build, hence the reason my onbuild is not being fired.