Skip to content

Commit f5fa5f0

Browse files
authored
documentation for additionalBuildCommands and additionalBuildFiles for the createAuxImage use case (#340)
1 parent 9dafb3e commit f5fa5f0

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

documentation/1.10/content/userguide/tools/create-aux-image.md

+37
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Usage: imagetool createAuxImage [OPTIONS]
2222
| Parameter | Definition | Default |
2323
| --- | --- | --- |
2424
| `--tag` | (Required) Tag for the final build image. Example: `store/oracle/mydomain:1` | |
25+
| `--additionalBuildCommands` | Path to a file with additional build commands. For more details, see [Additional information](#additional-information). |
26+
| `--additionalBuildFiles` | Additional files that are required by your `additionalBuildCommands`. A comma separated list of files that should be copied to the build context. |
2527
| `--builder`, `-b` | Executable to process the Dockerfile. Use the full path of the executable if not on your path. | `docker` |
2628
| `--buildNetwork` | Networking mode for the RUN instructions during the image build. See `--network` for Docker `build`. | |
2729
| `--chown` | `userid:groupid` for JDK/Middleware installs and patches. | `oracle:oracle` |
@@ -42,6 +44,41 @@ Usage: imagetool createAuxImage [OPTIONS]
4244

4345
### Additional information
4446

47+
#### `--additionalBuildCommands`
48+
49+
This is an advanced option that let's you provide additional commands to the Docker build step.
50+
The input for this parameter is a simple text file that contains one or more of the valid sections.
51+
Valid sections for `createAuxImage` are:
52+
53+
| Section | Build Stage | Timing |
54+
| --- | --- | --- |
55+
| `package-manager-packages` | All | A list of OS packages, such as `ftp gzip`, separated by line or space. |
56+
| `final-build-commands` | Final image | After all Image Tool actions are complete, and just before the container image is finalized. |
57+
58+
Each section can contain one or more valid Dockerfile commands and would look like the following:
59+
60+
```dockerfile
61+
[final-build-commands]
62+
LABEL owner="middleware team"
63+
COPY --chown=oracle:oracle files/my_additional_file.txt /auxiliary
64+
```
65+
66+
#### `--additionalBuildFiles`
67+
68+
This option provides a way to supply additional files to the image build command.
69+
All provided files and directories are copied directly under the `files` subfolder of the build context.
70+
To get those files into the image, additional build commands must be provided using the `additionalBuildCommands` options.
71+
Access to these files using a build command, such as `COPY` or `ADD`, should use the original filename
72+
with the folder prefix, `files/`. For example, if the
73+
original file was provided as `--additionalBuildFiles /scratch/test1/convenience.sh`, the Docker build command `COPY`
74+
provided in `--additionalBuildCommands` should look like
75+
`COPY --chown=oracle:oracle files/convenience.sh /my/internal/image/location`.
76+
Because Image Tool uses multi-stage
77+
builds, it is important to place the build command (like `COPY`) in the appropriate section of the `Dockerfile` based
78+
on when the build needs access to the file. For example, if the file is needed in the final image and not for
79+
installation or domain creation steps, use the `final-build-commands` section so that the `COPY` command occurs in the
80+
final stage of the image build.
81+
4582
#### `--target`
4683

4784
The file permissions in the Auxiliary image should match the container image where WebLogic Server is installed.

0 commit comments

Comments
 (0)