Skip to content

Commit 377dc4d

Browse files
Merge pull request #18741 from smarterclayton/multistage
Automatic merge from submit-queue (batch tested with PRs 18887, 18741). Support multi-stage dockerbuilds via imagebuilder Needs an e2e test and a way to perform replacement on the stage images. Will allow standard multi-stage Dockerfile builds against any Docker 1.12+ backend. API PR openshift/api#34
2 parents d05fad9 + 6f6a1d5 commit 377dc4d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1589
-904
lines changed

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ update:
126126
$(MAKE) build
127127
hack/update-generated-completions.sh
128128
hack/update-generated-docs.sh
129-
hack/update-generated-swagger-spec.sh
130129
.PHONY: update
131130

132131
# Update all generated artifacts for the API
@@ -136,7 +135,7 @@ update:
136135
update-api:
137136
hack/update-generated-conversions.sh
138137
hack/update-generated-defaulters.sh
139-
hack/update-generated-swagger-descriptions.sh
138+
hack/update-generated-deep-copies.sh
140139
hack/update-generated-openapi.sh
141140
$(MAKE) build
142141
hack/update-generated-swagger-spec.sh

api/docs/apis-build.openshift.io/v1.Build.adoc

+5-3
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,17 @@ Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-gu
142142
</div><div style="margin-left:13px;"> <span title="(string) ref is the branch/tag/ref to build.">ref</span>:
143143
</div><div style="margin-left:13px;"> <span title="(string) uri points to the source that will be built. The structure of the source will depend on the type of build to run">uri</span>:
144144
</div></details><details><summary> <span title="(array) images describes a set of images to be used to provide source for the build">images</span>:
145-
</summary><details><summary> - <span title="(v1.ObjectReference) from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to copy source from.">from</span>:
146-
</summary><div style="margin-left:13px;"> - <span title="(string) API version of the referent.">apiVersion</span>:
145+
</summary><details><summary> - <span title="(array) A list of image names that this source will be used in place of during a multi-stage Docker image build. For instance, a Dockerfile that uses &#34;COPY --from=nginx:latest&#34; will first check for an image source that has &#34;nginx:latest&#34; in this field before attempting to pull directly. If the Dockerfile does not reference an image source it is ignored. This field and paths may both be set, in which case the contents will be used twice.">as</span>:
146+
</summary><div style="margin-left:13px;"> - - <span title="(string)">[string]</span>:
147+
</div></details><details><summary> <span title="(v1.ObjectReference) from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to copy source from.">from</span>:
148+
</summary><div style="margin-left:13px;"> <span title="(string) API version of the referent.">apiVersion</span>:
147149
</div><div style="margin-left:13px;"> <span title="(string) If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: &#34;spec.containers{name}&#34; (where &#34;name&#34; refers to the name of the container that triggered the event) or if no container name is specified &#34;spec.containers[2]&#34; (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.">fieldPath</span>:
148150
</div><div style="margin-left:13px;"> <span title="(string) Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds">kind</span>:
149151
</div><div style="margin-left:13px;"> <span title="(string) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names">name</span>:
150152
</div><div style="margin-left:13px;"> <span title="(string) Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/">namespace</span>:
151153
</div><div style="margin-left:13px;"> <span title="(string) Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency">resourceVersion</span>:
152154
</div><div style="margin-left:13px;"> <span title="(string) UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids">uid</span>:
153-
</div></details><details><summary> <span title="(array) paths is a list of source and destination paths to copy from the image.">paths</span>:
155+
</div></details><details><summary> <span title="(array) paths is a list of source and destination paths to copy from the image. This content will be copied into the build context prior to starting the build. If no paths are set, the build context will not be altered.">paths</span>:
154156
</summary><div style="margin-left:13px;"> - <span title="(string) destinationDir is the relative directory within the build directory where files copied from the image are placed.">destinationDir</span>:
155157
</div><div style="margin-left:13px;"> <span title="(string) sourcePath is the absolute path of the file or directory inside the image to copy to the build directory. 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.">sourcePath</span>:
156158
</div></details><details><summary> <span title="(v1.LocalObjectReference) pullSecret is a reference to a secret to be used to pull the image from a registry If the image is pulled from the OpenShift registry, this field does not need to be set.">pullSecret</span>:

api/docs/apis-build.openshift.io/v1.BuildConfig.adoc

+5-3
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,17 @@ Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-gu
146146
</div><div style="margin-left:13px;"> <span title="(string) ref is the branch/tag/ref to build.">ref</span>:
147147
</div><div style="margin-left:13px;"> <span title="(string) uri points to the source that will be built. The structure of the source will depend on the type of build to run">uri</span>:
148148
</div></details><details><summary> <span title="(array) images describes a set of images to be used to provide source for the build">images</span>:
149-
</summary><details><summary> - <span title="(v1.ObjectReference) from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to copy source from.">from</span>:
150-
</summary><div style="margin-left:13px;"> - <span title="(string) API version of the referent.">apiVersion</span>:
149+
</summary><details><summary> - <span title="(array) A list of image names that this source will be used in place of during a multi-stage Docker image build. For instance, a Dockerfile that uses &#34;COPY --from=nginx:latest&#34; will first check for an image source that has &#34;nginx:latest&#34; in this field before attempting to pull directly. If the Dockerfile does not reference an image source it is ignored. This field and paths may both be set, in which case the contents will be used twice.">as</span>:
150+
</summary><div style="margin-left:13px;"> - - <span title="(string)">[string]</span>:
151+
</div></details><details><summary> <span title="(v1.ObjectReference) from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to copy source from.">from</span>:
152+
</summary><div style="margin-left:13px;"> <span title="(string) API version of the referent.">apiVersion</span>:
151153
</div><div style="margin-left:13px;"> <span title="(string) If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: &#34;spec.containers{name}&#34; (where &#34;name&#34; refers to the name of the container that triggered the event) or if no container name is specified &#34;spec.containers[2]&#34; (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.">fieldPath</span>:
152154
</div><div style="margin-left:13px;"> <span title="(string) Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds">kind</span>:
153155
</div><div style="margin-left:13px;"> <span title="(string) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names">name</span>:
154156
</div><div style="margin-left:13px;"> <span title="(string) Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/">namespace</span>:
155157
</div><div style="margin-left:13px;"> <span title="(string) Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency">resourceVersion</span>:
156158
</div><div style="margin-left:13px;"> <span title="(string) UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids">uid</span>:
157-
</div></details><details><summary> <span title="(array) paths is a list of source and destination paths to copy from the image.">paths</span>:
159+
</div></details><details><summary> <span title="(array) paths is a list of source and destination paths to copy from the image. This content will be copied into the build context prior to starting the build. If no paths are set, the build context will not be altered.">paths</span>:
158160
</summary><div style="margin-left:13px;"> - <span title="(string) destinationDir is the relative directory within the build directory where files copied from the image are placed.">destinationDir</span>:
159161
</div><div style="margin-left:13px;"> <span title="(string) sourcePath is the absolute path of the file or directory inside the image to copy to the build directory. 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.">sourcePath</span>:
160162
</div></details><details><summary> <span title="(v1.LocalObjectReference) pullSecret is a reference to a secret to be used to pull the image from a registry If the image is pulled from the OpenShift registry, this field does not need to be set.">pullSecret</span>:

api/docs/oapi/v1.Build.adoc

+5-3
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,17 @@ Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-gu
142142
</div><div style="margin-left:13px;"> <span title="(string) ref is the branch/tag/ref to build.">ref</span>:
143143
</div><div style="margin-left:13px;"> <span title="(string) uri points to the source that will be built. The structure of the source will depend on the type of build to run">uri</span>:
144144
</div></details><details><summary> <span title="(array) images describes a set of images to be used to provide source for the build">images</span>:
145-
</summary><details><summary> - <span title="(v1.ObjectReference) from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to copy source from.">from</span>:
146-
</summary><div style="margin-left:13px;"> - <span title="(string) API version of the referent.">apiVersion</span>:
145+
</summary><details><summary> - <span title="(array) A list of image names that this source will be used in place of during a multi-stage Docker image build. For instance, a Dockerfile that uses &#34;COPY --from=nginx:latest&#34; will first check for an image source that has &#34;nginx:latest&#34; in this field before attempting to pull directly. If the Dockerfile does not reference an image source it is ignored. This field and paths may both be set, in which case the contents will be used twice.">as</span>:
146+
</summary><div style="margin-left:13px;"> - - <span title="(string)">[string]</span>:
147+
</div></details><details><summary> <span title="(v1.ObjectReference) from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to copy source from.">from</span>:
148+
</summary><div style="margin-left:13px;"> <span title="(string) API version of the referent.">apiVersion</span>:
147149
</div><div style="margin-left:13px;"> <span title="(string) If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: &#34;spec.containers{name}&#34; (where &#34;name&#34; refers to the name of the container that triggered the event) or if no container name is specified &#34;spec.containers[2]&#34; (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.">fieldPath</span>:
148150
</div><div style="margin-left:13px;"> <span title="(string) Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds">kind</span>:
149151
</div><div style="margin-left:13px;"> <span title="(string) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names">name</span>:
150152
</div><div style="margin-left:13px;"> <span title="(string) Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/">namespace</span>:
151153
</div><div style="margin-left:13px;"> <span title="(string) Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency">resourceVersion</span>:
152154
</div><div style="margin-left:13px;"> <span title="(string) UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids">uid</span>:
153-
</div></details><details><summary> <span title="(array) paths is a list of source and destination paths to copy from the image.">paths</span>:
155+
</div></details><details><summary> <span title="(array) paths is a list of source and destination paths to copy from the image. This content will be copied into the build context prior to starting the build. If no paths are set, the build context will not be altered.">paths</span>:
154156
</summary><div style="margin-left:13px;"> - <span title="(string) destinationDir is the relative directory within the build directory where files copied from the image are placed.">destinationDir</span>:
155157
</div><div style="margin-left:13px;"> <span title="(string) sourcePath is the absolute path of the file or directory inside the image to copy to the build directory. 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.">sourcePath</span>:
156158
</div></details><details><summary> <span title="(v1.LocalObjectReference) pullSecret is a reference to a secret to be used to pull the image from a registry If the image is pulled from the OpenShift registry, this field does not need to be set.">pullSecret</span>:

api/docs/oapi/v1.BuildConfig.adoc

+5-3
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,17 @@ Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-gu
146146
</div><div style="margin-left:13px;"> <span title="(string) ref is the branch/tag/ref to build.">ref</span>:
147147
</div><div style="margin-left:13px;"> <span title="(string) uri points to the source that will be built. The structure of the source will depend on the type of build to run">uri</span>:
148148
</div></details><details><summary> <span title="(array) images describes a set of images to be used to provide source for the build">images</span>:
149-
</summary><details><summary> - <span title="(v1.ObjectReference) from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to copy source from.">from</span>:
150-
</summary><div style="margin-left:13px;"> - <span title="(string) API version of the referent.">apiVersion</span>:
149+
</summary><details><summary> - <span title="(array) A list of image names that this source will be used in place of during a multi-stage Docker image build. For instance, a Dockerfile that uses &#34;COPY --from=nginx:latest&#34; will first check for an image source that has &#34;nginx:latest&#34; in this field before attempting to pull directly. If the Dockerfile does not reference an image source it is ignored. This field and paths may both be set, in which case the contents will be used twice.">as</span>:
150+
</summary><div style="margin-left:13px;"> - - <span title="(string)">[string]</span>:
151+
</div></details><details><summary> <span title="(v1.ObjectReference) from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to copy source from.">from</span>:
152+
</summary><div style="margin-left:13px;"> <span title="(string) API version of the referent.">apiVersion</span>:
151153
</div><div style="margin-left:13px;"> <span title="(string) If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: &#34;spec.containers{name}&#34; (where &#34;name&#34; refers to the name of the container that triggered the event) or if no container name is specified &#34;spec.containers[2]&#34; (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.">fieldPath</span>:
152154
</div><div style="margin-left:13px;"> <span title="(string) Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds">kind</span>:
153155
</div><div style="margin-left:13px;"> <span title="(string) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names">name</span>:
154156
</div><div style="margin-left:13px;"> <span title="(string) Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/">namespace</span>:
155157
</div><div style="margin-left:13px;"> <span title="(string) Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency">resourceVersion</span>:
156158
</div><div style="margin-left:13px;"> <span title="(string) UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids">uid</span>:
157-
</div></details><details><summary> <span title="(array) paths is a list of source and destination paths to copy from the image.">paths</span>:
159+
</div></details><details><summary> <span title="(array) paths is a list of source and destination paths to copy from the image. This content will be copied into the build context prior to starting the build. If no paths are set, the build context will not be altered.">paths</span>:
158160
</summary><div style="margin-left:13px;"> - <span title="(string) destinationDir is the relative directory within the build directory where files copied from the image are placed.">destinationDir</span>:
159161
</div><div style="margin-left:13px;"> <span title="(string) sourcePath is the absolute path of the file or directory inside the image to copy to the build directory. 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.">sourcePath</span>:
160162
</div></details><details><summary> <span title="(v1.LocalObjectReference) pullSecret is a reference to a secret to be used to pull the image from a registry If the image is pulled from the OpenShift registry, this field does not need to be set.">pullSecret</span>:

0 commit comments

Comments
 (0)