mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-06 15:46:57 +01:00
73 lines
2.4 KiB
Plaintext
73 lines
2.4 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// <List assemblies here, each on a new line>
|
|
//* assembly/builds
|
|
|
|
// This module can be included from assemblies using the following include statement:
|
|
// include::<path>/builds-image-source.adoc[leveloffset=+1]
|
|
|
|
[id="image-source_{context}"]
|
|
= Image source
|
|
|
|
You can add additional files to the build process with images. Input images are
|
|
referenced in the same way the `From` and `To` image targets are defined. This
|
|
means both container images and imagestreamtags can be referenced. In
|
|
conjunction with the image, you must provide one or more path pairs to indicate
|
|
the path of the files or directories to copy the image and the destination to
|
|
place them in the build context.
|
|
|
|
The source path can be any absolute path within the image specified. The
|
|
destination must be a relative directory path. At build time, the image will be
|
|
loaded and the indicated files and directories will be copied into the context
|
|
directory of the build process. This is the same directory into which the source
|
|
repository content (if any) is cloned. If the source path ends in *_/._* then
|
|
the content of the directory will be copied, but the directory itself will not
|
|
be created at the destination.
|
|
|
|
Image inputs are specified in the `source` definition of the `BuildConfig`:
|
|
|
|
[source,yaml]
|
|
----
|
|
source:
|
|
git:
|
|
uri: https://github.com/openshift/ruby-hello-world.git
|
|
images: <1>
|
|
- from: <2>
|
|
kind: ImageStreamTag
|
|
name: myinputimage:latest
|
|
namespace: mynamespace
|
|
paths: <3>
|
|
- destinationDir: injected/dir <4>
|
|
sourcePath: /usr/lib/somefile.jar <5>
|
|
- from:
|
|
kind: ImageStreamTag
|
|
name: myotherinputimage:latest
|
|
namespace: myothernamespace
|
|
pullSecret: mysecret <6>
|
|
paths:
|
|
- destinationDir: injected/dir
|
|
sourcePath: /usr/lib/somefile.jar
|
|
----
|
|
<1> An array of one or more input images and files.
|
|
<2> A reference to the image containing the files to be copied.
|
|
<3> An array of source/destination paths.
|
|
<4> The directory relative to the build root where the build process can access the file.
|
|
<5> The location of the file to be copied out of the referenced image.
|
|
<6> An optional secret provided if credentials are needed to access the input image.
|
|
|
|
ifndef::openshift-online[]
|
|
[NOTE]
|
|
====
|
|
This feature is not supported for builds using the Custom Strategy.
|
|
====
|
|
endif::[]
|
|
|
|
/////
|
|
.Additional resources
|
|
|
|
* Custom Strategy
|
|
ifndef::openshift-online[]
|
|
* ImageStreamTags
|
|
endif::[]
|
|
/////
|