Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic "opatch apply" #1070

xtender opened this issue Dec 5, 2018 · 4 comments

Automatic "opatch apply" #1070

xtender opened this issue Dec 5, 2018 · 4 comments


Copy link

@xtender xtender commented Dec 5, 2018

It would be great to have an ability to upload patches into special volume for patches and container installs them automatically (unzip && cd {patch_number} && opatch apply for each of them)

Copy link

@xtender xtender commented Dec 6, 2018

I did it for own images:

  1. created patches directory and put into this directory:
# cat

unzip  -u ./*.zip

for D in *; do
    if [ -d "${D}" ]; then
        echo =================================================
        echo " *** Processing patch # ${D}... "   # your processing here
        cd "${D}"
        opatch apply -silent
    cd $CURDIR

  1. added into dockerfile the following commands:
COPY --chown=oracle:dba patches $INSTALL_DIR/patches

# Install DB software binaries
USER oracle
RUN chmod ug+x $INSTALL_DIR/patches/*.sh && \
    sync && \
    cd $INSTALL_DIR/patches && \

Copy link

@xtender xtender commented Dec 6, 2018

So I can put downloaded patches into this directory and they will be installed automatically

@gvenzl gvenzl self-assigned this Dec 10, 2018
Copy link

@gvenzl gvenzl commented Dec 10, 2018

What you really want to do is create a patched image that is tagged appropriately, rather than having an image that says oracle/database:18.3.0-ee but in fact isn't an 18.3.0-ee image anymore.
You also have to make sure that the database data dictionary has been patched as well, so you can't just startup a image which includes patches against random database files.

You will find a sample of how you can build patched images in SingleInstane/samples/applypatch

Copy link

@theBNT theBNT commented Mar 29, 2021

Thank you @xtender for this suggestion (and your related blog post) and sorry everybody else for reviving this old issue, but i think providing a standardized update mechanism for Oracle Docker images is something of big help for many users.

Currently, im trying to patch the 19.3.0 with the RU patch 32226239 (provided via file in order to mitigate a problem which occurs during import into a dockerbased database.

It seems the linked procedure is at least off by the folder structure because opatch quits with

ZOP-51: The patch location is not valid for apply, because it doesn't have correct metadata, or it points to a patch directory.
Argument(s) Error... Patch location is not valid for apply

Although this might be then more related to #1820

Or is this what OracleDatabase/SingleInstance/extensions/patching is for?

After fixing the folder traversal, im running into "File not found or not writable" errors during opatch, so any help appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants