|
1 | 1 | # Building an Oracle Internet Directory image with WebLogic Image Tool
|
2 | 2 |
|
3 |
| -## Contents |
| 3 | +## Documentation |
4 | 4 |
|
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. |
13 | 6 |
|
14 |
| -## 1. Introduction |
15 | 7 |
|
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 |
202 | 9 | 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.
|
203 | 10 |
|
204 | 11 | 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.
|
205 | 12 |
|
206 |
| -### Copyright |
207 |
| -Copyright (c) 2021, Oracle and/or its affiliates. |
| 13 | +## Copyright |
| 14 | +Copyright (c) 2021, 2022, Oracle and/or its affiliates. |
208 | 15 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
|
0 commit comments