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

Open
xtender opened this Issue Dec 5, 2018 · 3 comments

Comments

2 participants
@xtender
Copy link

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)

@xtender

This comment has been minimized.

Copy link

xtender commented Dec 6, 2018

I did it for own images:

  1. created patches directory and put install_patches.sh into this directory:
# cat install_patches.sh
#!/bin/bash

unzip  -u ./*.zip
CURDIR=`pwd`

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

  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 && \
    ./install_patches.sh

@xtender

This comment has been minimized.

Copy link

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

@gvenzl gvenzl added the database label Dec 10, 2018

@gvenzl

This comment has been minimized.

Copy link
Member

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

@gvenzl gvenzl added the enhancement label Dec 10, 2018

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