docker-images icon indicating copy to clipboard operation
docker-images copied to clipboard

Make db docker builds more friendly to thinkering by allowing docker to cache layers

Open gggeek opened this issue 5 years ago • 5 comments

Given the fact that the recommended way to use the DB docker images is to fork the code in this repo, it stands to reason that the users might want to tweak the builds by adding any required changes.

At the moment, the Oracle18xe image is not very friendly to tinkering around because:

  • it does both download the Oracle installer and run it in a single docker RUN line
  • it does push to the image all the shell files before downloading the Oracle installer

This means that, if the user wants to make a minor change to, say, runOracle.sh, when she will then rebuild the image, the whole download+reinstall will happen again.

I think that it would be better to take advantage of docker's ability to cache each layer in the build process, and:

  • split the current RUN command into a few distinct lines
  • move the copying of shell files into the container to after the download and execution of the oracle installer

I can send a PR for this if there is agreement

gggeek avatar Feb 27 '20 08:02 gggeek

This sounds OK as long as the newly splirt RUN directive doesn't cause the layers to grow too large, i.e. the download, install and removal of the download must still be in a single layer. I agree that copying the scripts after the install would be more efficient from a caching perspective.

Before you submit a PR, can you confirm whether you've signed the Oracle Contributor Agreement?

Djelibeybi avatar Feb 27 '20 19:02 Djelibeybi

Agree on download+remove in one step. Will sign and mail back the OCA asap.

gggeek avatar Feb 27 '20 22:02 gggeek

Will sign and mail back the OCA asap.

Let me know when you do, so I can action it too.

Djelibeybi avatar Feb 27 '20 22:02 Djelibeybi

OCA submitted by email

gggeek avatar Feb 28 '20 20:02 gggeek

OCA submitted by email

Groovy. It's Saturday here, so I'll process it on Monday local time.

Djelibeybi avatar Feb 28 '20 20:02 Djelibeybi