Skip to content

Commit 38b65fb

Browse files
idm_22.2.1_release (#2348)
1 parent 719cf15 commit 38b65fb

File tree

12 files changed

+95
-798
lines changed

12 files changed

+95
-798
lines changed

OracleAccessManagement/imagetool/12.2.1.4.0/additionalBuildCmds.txt

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[package-manager-packages]
2+
hostname
3+
14
[final-build-commands]
25

36
ENV FMW_IDM_JAR=fmw_12.2.1.4.0_idm_generic.jar \
@@ -23,24 +26,27 @@ ENV FMW_IDM_JAR=fmw_12.2.1.4.0_idm_generic.jar \
2326
DB_SCHEMA_PASSWORD=${DB_SCHEMA_PASSWORD:-} \
2427
USER_MEM_ARGS=${USER_MEM_ARGS:-"-Djava.security.egd=file:/dev/./urandom"} \
2528
JAVA_OPTIONS="${JAVA_OPTIONS} -Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true" \
26-
PATH=$PATH:/usr/java/default/bin:$ORACLE_HOME/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle/dockertools
29+
PATH=$PATH:/usr/java/default/bin:$ORACLE_HOME/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle/dockertools \
30+
HEALTH_SCRIPT_FILE=/u01/oracle/dockertools/get_healthcheck_url.sh
2731

2832
USER root
2933

3034
RUN mkdir -p ${USER_PROJECTS_DIR} && \
31-
chown -R oracle:oracle ${USER_PROJECTS_DIR} && chmod -R 775 ${USER_PROJECTS_DIR} && \
35+
chown -R oracle:root ${USER_PROJECTS_DIR} && chmod -R 775 ${USER_PROJECTS_DIR} && \
36+
chown -R oracle:root ${BASE_DIR} && \
3237
mkdir -p ${CONTAINER_DIR} && \
33-
chown -R oracle:oracle ${CONTAINER_DIR} && chmod -R 775 ${CONTAINER_DIR} && \
34-
mkdir -p ${SCRIPT_DIR} && chown oracle:oracle ${SCRIPT_DIR} && \
35-
mkdir -p ${PROPS_DIR} && chown oracle:oracle ${PROPS_DIR} && \
36-
yum install -y hostname && \
37-
rm -rf /var/cache/yum
38+
chown -R oracle:root ${CONTAINER_DIR} && chmod -R 775 ${CONTAINER_DIR} && \
39+
mkdir -p ${SCRIPT_DIR} && chown oracle:root ${SCRIPT_DIR} && \
40+
mkdir -p ${PROPS_DIR} && chown oracle:root ${PROPS_DIR}
3841

3942

40-
COPY --chown=oracle:oracle files/container-scripts/ ${SCRIPT_DIR}/
43+
COPY --chown=oracle:root files/container-scripts/ ${SCRIPT_DIR}/
4144
RUN chmod a+xr ${SCRIPT_DIR}/* && \
42-
chown -R oracle:oracle ${SCRIPT_DIR}
45+
chown -R oracle:root ${SCRIPT_DIR} && \
46+
sed -i '/@@audit\/createCASBAudit.sql/s/@@audit\/createCASBAudit.sql/--@@audit\/createCASBAudit.sql/g' /u01/oracle/idm/common/sql/oam/sql/oam.sql && \
47+
sed -i '/@@diagnostic\/createIdmDiagnosticLogRecord.sql/s/@@diagnostic\/createIdmDiagnosticLogRecord.sql/--@@diagnostic\/createIdmDiagnosticLogRecord.sql/g' /u01/oracle/idm/common/sql/oam/sql/oam.sql
4348

4449
USER oracle
50+
HEALTHCHECK --start-period=5m --interval=1m CMD curl -k -s --fail `$HEALTH_SCRIPT_FILE` || exit 1
4551
WORKDIR $ORACLE_HOME
4652
CMD ["sh", "-c", "${SCRIPT_DIR}/createDomainAndStart.sh"]

OracleAccessManagement/imagetool/12.2.1.4.0/buildArgs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ create
44
--version=12.2.1.4.0
55
--tag=%BUILDTAG%
66
--pull
7+
--chown oracle:root
78
--installerResponseFile %DOCKER_REPO%/OracleFMWInfrastructure/dockerfiles/12.2.1.4.0/install.file,%DOCKER_REPO%/OracleAccessManagement/dockerfiles/12.2.1.4.0/install/iam.response
89
--additionalBuildCommands %DOCKER_REPO%/OracleAccessManagement/imagetool/12.2.1.4.0/additionalBuildCmds.txt
910
--additionalBuildFiles %DOCKER_REPO%/OracleAccessManagement/dockerfiles/12.2.1.4.0/container-scripts
Original file line numberDiff line numberDiff line change
@@ -1,208 +1,15 @@
11
# Building an Oracle Internet Directory image with WebLogic Image Tool
22

3-
## Contents
3+
## Documentation
44

5-
1. [Introduction](#1-introduction)
6-
2. [Prerequisites](#2-prerequisites)
7-
3. [Setup WebLogic Image Tool](#3-setup-weblogic-image-tool)
8-
4. [Download the required packages and installers](#4-download-the-required-packagesinstallers-and-patches)
9-
5. [Required build files](#5-required-build-files)
10-
6. [Additional build commands](#6-additional-build-commands)
11-
7. [Steps to Create Oracle Internet Directory image](#7-steps-to-create-oracle-internet-directory-image)
12-
8. [Generate Sample dockerfile with imagetool](#8-generate-sample-dockerfile-with-imagetool)
5+
Detailed instructions on how to [create or update an Oracle Internet Directory container image](https://oracle.github.io/fmw-kubernetes/oid/create-or-update-image#create-or-update-an-oracle-internet-directory-services-manager-image-using-the-weblogic-image-tool) using the WebLogic Image Tool can be found in the [Oracle Fusion Middleware on Kubernetes](https://oracle.github.io/fmw-kubernetes/) documentation.
136

14-
## 1. Introduction
157

16-
This README describes the steps involved in building an Oracle Internet Directory image with the WebLogic Image Tool.
17-
18-
## 2. Prerequisites
19-
20-
The following prerequisites are necessary before building Oracle Internet Directory container images with WebLogic Image Tool:
21-
22-
* A working installation of Docker 18.03.1 or later
23-
* Bash version 4.0 or later (commands should be run in a `bash` shell)
24-
* `JAVA_HOME` environment variable set to the location of your JDK e.g: `/scratch/export/oracle/product/jdk`
25-
* git and unzip
26-
* Set `WORK_DIR` variable to a desired location of your choice e.g: `/scratch/`
27-
28-
## 3. Setup WebLogic Image Tool
29-
30-
* Download the latest version of [WebLogic Image Tool](https://github.com/oracle/weblogic-image-tool/releases).
31-
* Extract the release archive (zip, tar.gz) content into `WORK_DIR`.
32-
33-
```bash
34-
$ unzip imagetool.zip
35-
Archive: imagetool.zip
36-
creating: imagetool/
37-
creating: imagetool/lib/
38-
inflating: imagetool/lib/fluent-hc-4.5.12.jar
39-
inflating: imagetool/lib/httpclient-4.5.12.jar
40-
inflating: imagetool/lib/httpcore-4.4.13.jar
41-
inflating: imagetool/lib/commons-logging-1.2.jar
42-
inflating: imagetool/lib/commons-codec-1.11.jar
43-
inflating: imagetool/lib/httpmime-4.5.12.jar
44-
inflating: imagetool/lib/picocli-4.3.2.jar
45-
inflating: imagetool/lib/json-20200518.jar
46-
inflating: imagetool/lib/compiler-0.9.10.jar
47-
creating: imagetool/bin/
48-
inflating: imagetool/bin/setup.sh
49-
inflating: imagetool/bin/logging.properties
50-
inflating: imagetool/bin/imagetool.cmd
51-
inflating: imagetool/bin/imagetool.sh
52-
inflating: imagetool/LICENSE.txt
53-
inflating: imagetool/lib/imagetool_completion.sh
54-
inflating: imagetool/lib/imagetool.jar
55-
inflating: imagetool/VERSION.txt
56-
$
57-
```
58-
59-
* Run the following commands to setup imagetool
60-
61-
```bash
62-
$ cd $WORK_DIR/imagetool/bin
63-
$ source setup.sh
64-
```
65-
66-
* Execute the following to validate the WebLogic Image Tool:
67-
68-
```bash
69-
$ imagetool --version
70-
imagetool:1.9.16
71-
$
72-
```
73-
74-
The WebLogic Image Tool creates a temporary Docker context directory, prefixed by wlsimgbuilder_temp, every time the tool runs.
75-
Under normal circumstances, this context directory will be deleted.
76-
However, if the process is aborted or the tool is unable to remove the directory, it is safe for you to delete it manually.
77-
By default, the WebLogic Image Tool creates the Docker context directory under the user's home directory.
78-
If you prefer to use a different directory for the temporary context, set the environment variable `WLSIMG_BLDDIR`.
79-
80-
```bash
81-
$ export WLSIMG_BLDDIR="/path/to/dir"
82-
```
83-
84-
The WebLogic Image Tool maintains a local file cache store.
85-
This store is used to look up where the Java, WebLogic Server installers, and WebLogic Server patches reside in the local file system.
86-
By default, the cache store is located in the user's `$HOME/cache` directory. Under this directory, the lookup information is stored in the metadata file.
87-
All automatically downloaded patches also reside in this directory. You can change the default cache store location by setting the environment variable `WLSIMG_CACHEDIR`.
88-
89-
```bash
90-
$ export WLSIMG_CACHEDIR="/path/to/cachedir"
91-
```
92-
93-
## 4. Download the required packages,installers and patches
94-
95-
Download the required installers from the [Oracle Software Delivery Cloud](https://edelivery.oracle.com/) and save them in a directory of your choice e.g: `$WORK_DIR/stage`:
96-
97-
Create a stage directory under `$WORK_DIR` for downloading the below installers by using the following command:
98-
99-
```bash
100-
$ mkdir -p $WORK_DIR/stage
101-
```
102-
103-
* Oracle Internet Directory 12.2.1.4.0
104-
* Oracle JDK
105-
* Oracle Fusion Middleware Infrastructure 12.2.1.4.0
106-
107-
**Note**: If the image is required to have patches included, download patches from [My Oracle Support](https://support.oracle.com) and copy to `WORK_DIR/stage`.
108-
109-
## 5. Required build files
110-
111-
The Oracle Internet Directory image requires additional files for creating and starting the Oracle Internet Directory instance in the container. Clone the Oracle docker-images repository [repository](https://github.com/oracle/docker-images). For example:
112-
113-
```bash
114-
$ cd $WORK_DIR
115-
$ git clone https://github.com/oracle/docker-images
116-
```
117-
118-
This will create the required directories and files under `$WORK_DIR/docker-images`.
119-
120-
The files required for creation of the Oracle Internet Directory image can be located in the `$WORK_DIR/docker-images/OracleInternetDirectory/dockerfiles/12.2.1.4.0/container-scripts directory`.
121-
122-
## 6. Additional build commands
123-
124-
Oracle Internet Directory image requires additional build commands to set the required environment variables, install os packages and copy the additional build files to the image being built.
125-
126-
A sample additional build commands input file can be found at `$WORK_DIR/docker-images/OracleInternetDirectory/imagetool/12.2.1.4.0/additionalBuildCmds.txt`.
127-
128-
129-
## 7. Steps to Create Oracle Internet Directory image
130-
131-
Add the required installers, packages and patches to the imagetool cache by running the following commands.
132-
133-
### i) Add JDK package to Imagetool cache
134-
135-
```bash
136-
$ imagetool cache addInstaller --type jdk --version 8u301 --path $WORK_DIR/stage/jdk-8u301-linux-x64.tar.gz
137-
```
138-
139-
### ii) Add installers to Imagetool cache
140-
141-
```bash
142-
$ imagetool cache addInstaller --type oid --version 12.2.1.4.0 --path $WORK_DIR/stage/fmw_12.2.1.4.0_oid_linux64.bin
143-
$ imagetool cache addInstaller --type fmw --version 12.2.1.4.0 --path $WORK_DIR/stage/fmw_12.2.1.4.0_infrastructure.jar
144-
```
145-
146-
### iii) Add Patches to Imagetool cache
147-
In case patches are required to be included in image, they should be added to Imagetool cache:
148-
149-
```bash
150-
$ imagetool cache addEntry --key 28186730_13.9.4.2.2 --value $WORK_DIR/stage/p28186730_139422_Generic.zip
151-
$ imagetool cache addEntry --key 31400392_12.2.1.4.0 --value $WORK_DIR/stage/p31400392_122140_Generic.zip
152-
```
153-
154-
### iv) Create the Oracle Internet Directory image
155-
156-
Execute the `imagetool create` command to create the Oracle Internet Directory image.
157-
158-
The following parameters are provided as input to the create command,
159-
160-
* `jdkVersion` - JDK version to be used in the image.
161-
* `type` - type of image to be built.
162-
* `version` - version of the image.
163-
* `tag` - tag name for the image.
164-
* `additionalBuildCommands` - additional build commands provided as a text file.
165-
* `addtionalBuildFiles` - path of additional build files as comma separated list.
166-
167-
168-
Below is a sample command used to build an Oracle Internet Directory image.
169-
170-
```bash
171-
$ imagetool create --jdkVersion=8u301 --type oid --version=12.2.1.4.0 \
172-
--tag=oracle/oid:12.2.1.4.0 \
173-
--chown=oracle:root \
174-
--additionalBuildCommands $WORK_DIR/docker-images/OracleInternetDirectory/imagetool/12.2.1.4.0/additionalBuildCmds.txt \
175-
--additionalBuildFiles $WORK_DIR/docker-images/OracleInternetDirectory/dockerfiles/12.2.1.4.0/container-scripts \
176-
--patches <patch_a>,<patch_b>,...
177-
```
178-
> --`patches` option is required only when image is required to be generated with patches
179-
180-
### v) View the Docker image
181-
182-
Run the `docker images` command to ensure the new Oracle Internet Directory image is loaded into the repository:
183-
184-
```bash
185-
$ docker images
186-
REPOSITORY TAG IMAGE ID CREATED SIZE
187-
oracle/oid 12.2.1.4.0 09294d0fd357 About an hour ago 5.09GB
188-
...
189-
```
190-
191-
## 8. Generate sample `Dockerfile` with imagetool
192-
193-
If you want to review a sample `Dockerfile` created with the imagetool issue the `imagetool` command with the `--dryRun` option:
194-
195-
196-
```bash
197-
imagetool @$WORK_DIR/docker-images/OracleInternetDirectory/imagetool/12.2.1.4.0/buildArgs --dryRun
198-
```
199-
200-
201-
### License
8+
## License
2029
To download and run Oracle Fusion Middleware products, regardless whether inside or outside a container, you must download the binaries from the Oracle website and accept the license indicated at that page.
20310

20411
All scripts and files hosted in this project and GitHub [docker-images/OracleInternetDirectory](./) repository required to build the images are, unless otherwise noted, released under [UPL 1.0](https://oss.oracle.com/licenses/upl/) license.
20512

206-
### Copyright
207-
Copyright (c) 2021, Oracle and/or its affiliates.
13+
## Copyright
14+
Copyright (c) 2021, 2022, Oracle and/or its affiliates.
20815
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl

OracleUnifiedDirectory/dockerfiles/12.2.1.4.0/Dockerfile

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020 Oracle and/or its affiliates.
2+
# Copyright (c) 2020, 2022, Oracle and/or its affiliates.
33
#
44
# Licensed under the Universal Permissive License v 1.0 as shown at
55
# https://oss.oracle.com/licenses/upl.
@@ -50,12 +50,12 @@ USER root
5050
RUN mkdir -p ${BASE_DIR} && \
5151
mkdir -p ${PATCHES_BASE_DIR}/opatch_patch && \
5252
mkdir -p ${PATCHES_BASE_DIR}/patches && \
53-
useradd -b ${BASE_DIR} -d ${ORACLE_HOME} -m -s /bin/bash oracle && \
54-
chmod -R a+xr ${PATCHES_BASE_DIR} && chown -R oracle:oracle ${PATCHES_BASE_DIR} && \
55-
chmod -R a+xr ${BASE_DIR} && chown -R oracle:oracle ${BASE_DIR} && \
53+
useradd -b ${BASE_DIR} -d ${ORACLE_HOME} -g root -m -s /bin/bash oracle && \
54+
chmod -R a+xr ${PATCHES_BASE_DIR} && chown -R oracle:root ${PATCHES_BASE_DIR} && \
55+
chmod -R a+xr ${BASE_DIR} && chown -R oracle:root ${BASE_DIR} && \
5656
mkdir -p ${USER_PROJECTS_DIR} && \
57-
chown -R oracle:oracle ${USER_PROJECTS_DIR} && chmod -R 770 ${USER_PROJECTS_DIR} && \
58-
mkdir -p ${SCRIPT_DIR} && chown oracle:oracle ${SCRIPT_DIR} && \
57+
chown -R oracle:root ${USER_PROJECTS_DIR} && chmod -R 770 ${USER_PROJECTS_DIR} && \
58+
mkdir -p ${SCRIPT_DIR} && chown oracle:root ${SCRIPT_DIR} && \
5959
yum install -y libaio hostname vi && \
6060
rm -rf /var/cache/yum
6161

@@ -68,17 +68,17 @@ FROM base as builder
6868
COPY container-scripts/* ${SCRIPT_DIR}/
6969
COPY install/* ${BASE_DIR}/
7070
ADD $FMW_OUD_JAR ${BASE_DIR}/
71-
COPY --chown=oracle:oracle Dockerfile opatch_patch/* ${PATCHES_BASE_DIR}/opatch_patch/
72-
COPY --chown=oracle:oracle Dockerfile patches/* ${PATCHES_BASE_DIR}/patches/
71+
COPY --chown=oracle:root Dockerfile opatch_patch/* ${PATCHES_BASE_DIR}/opatch_patch/
72+
COPY --chown=oracle:root Dockerfile patches/* ${PATCHES_BASE_DIR}/patches/
7373

7474
#
7575
# Update Permissions for packages and scripts
7676
# --------------------------------------------
7777
RUN cd ${BASE_DIR} && chmod 755 *.jar && \
7878
chmod a+xr ${SCRIPT_DIR}/* && \
79-
chown -R oracle:oracle ${SCRIPT_DIR} && \
80-
chown -R oracle:oracle ${BASE_DIR} && \
81-
chown -R oracle:oracle ${PATCHES_BASE_DIR}
79+
chown -R oracle:root ${SCRIPT_DIR} && \
80+
chown -R oracle:root ${BASE_DIR} && \
81+
chown -R oracle:root ${PATCHES_BASE_DIR}
8282

8383
#
8484
# Installation of OUD Binaries
@@ -150,8 +150,8 @@ RUN export OPATCH_NO_FUSER=TRUE && patchzips=`ls ${PATCHES_BASE_DIR}/patches/p*.
150150
# -------------
151151
FROM base
152152

153-
COPY --chown=oracle:oracle --from=builder $BASE_DIR $BASE_DIR
154-
COPY --chown=oracle:oracle --from=builder $JAVA_HOME $JAVA_HOME
153+
COPY --chown=oracle:root --from=builder $BASE_DIR $BASE_DIR
154+
COPY --chown=oracle:root --from=builder $JAVA_HOME $JAVA_HOME
155155

156156
USER oracle
157157
WORKDIR ${ORACLE_HOME}

0 commit comments

Comments
 (0)