# Oracle Linux 8: the OS family real 19c targets run on. No Oracle Database inside;
# OPG's test harness supplies fake sqlplus/opatch/lsnrctl binaries.
FROM oraclelinux:8
# python39 only for two test files that need Python 3.7+ (see lab step 2); sudo + acl for the bootstrap suite.
RUN dnf -y install git python3 python39 openssl util-linux procps-ng findutils hostname which diffutils unzip zip sudo acl \
 && dnf clean all
# Run as an unprivileged "oracle" user in group "oinstall", like a real DB host.
RUN groupadd -g 54321 oinstall && useradd -u 54321 -g oinstall -m oracle
ARG OPG_REV=fb86948842c4794119dfa0c551b7661bb17659ce
RUN git clone https://github.com/stefanv2/oracle-patch-guard.git /opt/opg \
 && git -C /opt/opg checkout -q "$OPG_REV" && chown -R oracle:oinstall /opt/opg
USER oracle
WORKDIR /opt/opg/project
