This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Chapter 3. Builds and Images
3.1. BuildConfigs Copy linkLink copied to clipboard!
3.1.1. Description of Resource Copy linkLink copied to clipboard!
Build configurations define a build process for new Docker images. There are three types of builds possible - a Docker build using a Dockerfile, a Source-to-Image build that uses a specially prepared base image that accepts source code that it can make runnable, and a custom build that can run arbitrary Docker images as a base and accept the build parameters. Builds run on the cluster and on completion are pushed to the Docker registry specified in the "output" section. A build can be triggered via a webhook, when the base image changes, or when a user manually requests a new build be created.
Each build created by a build configuration is numbered and refers back to its parent configuration. Multiple builds can be triggered at once. Builds that do not have "output" set can be used to test code or run a verification build.
3.1.2. Creating a New BuildConfig Copy linkLink copied to clipboard!
3.1.2.1. Request Breakdown Copy linkLink copied to clipboard!
Creating a new buildconfig requires one request:
-
A POST request to the
buildconfigs
subresource of the namespace.
The POST request uses a BuildConfig
configuration in the request body. The following example uses a BuildConfig
for the Jboss Developer kitchensink
quickstart found at https://github.com/jboss-developer/jboss-eap-quickstarts.
3.1.2.2. POST Request to Create a New BuildConfig Copy linkLink copied to clipboard!
Request Header
Request Body
3.1.3. Listing All BuildConfigs in an Environment Copy linkLink copied to clipboard!
3.1.3.1. Request Breakdown Copy linkLink copied to clipboard!
Listing all the buildconfigs in an environment requires one request:
-
A GET request to the
buildconfigs
resource.
The GET request returns the BuildConfigList
, listing the details of all buildconfigs in the environment.
3.1.3.2. GET Request to Return All BuildConfigs in an Environment Copy linkLink copied to clipboard!
Request Header
3.1.4. Listing all BuildConfigs in a Namespace Copy linkLink copied to clipboard!
3.1.4.1. Request Breakdown Copy linkLink copied to clipboard!
Listing all the buildconfigs in a namespace requires one request:
-
A GET request to the
buildconfigs
subresource of the namespace.
The GET request returns the BuildConfigList
, listing the details of all buildconfigs in the namespace.
3.1.4.2. GET Request to Return BuildConfigs in Namespace Copy linkLink copied to clipboard!
Request Header
3.1.5. Listing a Specific BuildConfig Configuration Copy linkLink copied to clipboard!
3.1.5.1. Request Breakdown Copy linkLink copied to clipboard!
Listing a specific buildconfig configuration requires one request:
-
A GET request to the buildconfig name in the
buildconfigs
subresource of the namespace.
The GET request returns the BuildConfig
configuration for the specified build.
3.1.5.2. GET Request to Return Specific BuildConfig Configuration Copy linkLink copied to clipboard!
Request Header
3.1.6. Deleting a BuildConfig Copy linkLink copied to clipboard!
3.1.6.1. Request Breakdown Copy linkLink copied to clipboard!
Deleting a buildconfig requires one request:
-
A DELETE request to the buildconfig name in the
buildconfigs
subresource of the namespace.
The DELETE request returns a code: 200
and the buildconfig is deleted.
3.1.6.2. DELETE Request to Delete BuildConfig Copy linkLink copied to clipboard!
Request Header
3.2. Builds Copy linkLink copied to clipboard!
3.2.1. Description of Resource Copy linkLink copied to clipboard!
A build is the process of transforming input parameters into a resulting object. Most often, the process is used to transform input parameters or source code into a runnable image. A BuildConfig object is the definition of the entire build process.
3.2.2. Listing All Builds in an Environment Copy linkLink copied to clipboard!
3.2.2.1. Request Breakdown Copy linkLink copied to clipboard!
Listing all the builds in an environment requires one request:
-
A GET request to the
builds
resource.
The GET request returns the BuildList
, listing the details of all builds in the environment.
3.2.2.2. GET Request to Return All Builds in an Environment Copy linkLink copied to clipboard!
Request Header
3.2.3. Listing all Builds in a Namespace Copy linkLink copied to clipboard!
3.2.3.1. Request Breakdown Copy linkLink copied to clipboard!
Listing all the builds in a namespace requires one request:
-
A GET request to the
builds
subresource of the namespace.
The GET request returns the BuildList
, listing the details of all builds in the namespace.
3.2.3.2. GET Request to Return Builds in Namespace Copy linkLink copied to clipboard!
Request Header
3.2.4. Listing a Specific Build Configuration Copy linkLink copied to clipboard!
3.2.4.1. Request Breakdown Copy linkLink copied to clipboard!
Listing a specific build configuration requires one request:
-
A GET request to the build name in the
builds
subresource of the namespace.
The GET request returns the Build
configuration for the specified build.
3.2.4.2. GET Request to Return Specific Build Configuration Copy linkLink copied to clipboard!
Request Header
3.2.5. Starting a Build Copy linkLink copied to clipboard!
3.2.5.1. Request Breakdown Copy linkLink copied to clipboard!
Starting a build requires one request:
-
A POST request to the
instantiate
subresource of theBuildConfig
name.
The POST request returns a BuildConfig
configuration.
3.2.5.2. POST Request to Start a Build Copy linkLink copied to clipboard!
Request Header
Request Body
3.2.6. Cancelling a Build Copy linkLink copied to clipboard!
3.2.6.1. Request Breakdown Copy linkLink copied to clipboard!
Cancelling a build consists of two requests:
-
A GET request to the build name in the
builds
subresource of the namespace. -
A PUT request with an added
cancelled
field to the build name in thebuilds
subresource of the namespace.
The GET request returns a Build
configuration.
The GET request is optional if an updated Build
configuration can otherwise be provided for the PUT request.
Include a spec: status: cancelled
parameter with value true
in the Build
configuration. Send the updated configuration as the request body in a PUT request to the build name.
3.2.6.2. GET Request to Return Build Configuration Copy linkLink copied to clipboard!
Request Header
3.2.6.3. PUT Request to Cancel a Build Copy linkLink copied to clipboard!
Request Header
Request Body Snippet
... spec: status: cancelled: "true" ...
...
spec:
status:
cancelled: "true"
...
3.2.7. Deleting a Build Copy linkLink copied to clipboard!
3.2.7.1. Request Breakdown Copy linkLink copied to clipboard!
Deleting a build requires one request:
-
A DELETE request to the build name in the
builds
subresource of the namespace.
The DELETE request returns a code: 200
and the build is deleted.
3.2.7.2. DELETE Request to Delete Build Copy linkLink copied to clipboard!
Request Header
3.3. Images Copy linkLink copied to clipboard!
3.3.1. Description of Resource Copy linkLink copied to clipboard!
An image is a binary that includes all of the requirements for running a single container, as well as metadata describing its needs and capabilities.
3.3.2. Creating an Image Copy linkLink copied to clipboard!
3.3.2.1. Request Breakdown Copy linkLink copied to clipboard!
Creating a new image requires one request:
-
A POST request to the
images
subresource of the namespace.
The POST request uses an Image
configuration in the request body.
3.3.2.2. POST Request to Create a New Image Copy linkLink copied to clipboard!
Request Header
Request Body
apiVersion: v1 kind: Image metadata: name: {$IMAGE} dockerImageReference: registry.access.redhat.com/openshift3/jenkins-1-rhel7@sha256:9a370e38aca93da91bda03107f74fc245b169a8c642daf431a93289f44e187a0
apiVersion: v1
kind: Image
metadata:
name: {$IMAGE}
dockerImageReference: registry.access.redhat.com/openshift3/jenkins-1-rhel7@sha256:9a370e38aca93da91bda03107f74fc245b169a8c642daf431a93289f44e187a0
3.3.3. Listing All Images in a Cluster Copy linkLink copied to clipboard!
3.3.3.1. Request Breakdown Copy linkLink copied to clipboard!
Listing all the images in a cluster requires one request:
-
A GET request to the
images
resource.
The GET request returns the ImageList
, listing the details of all images in the cluster.
3.3.3.2. GET Request to Return All Images in a Cluster Copy linkLink copied to clipboard!
Request Header
3.3.4. Listing a Specific Image Configuration Copy linkLink copied to clipboard!
3.3.4.1. Request Breakdown Copy linkLink copied to clipboard!
Listing a specific image configuration in a cluster requires one request:
-
A GET request to the
sha256:
-prefixed image hash in theimages
resource.
The GET request returns the Image
configuration for the specified image.
3.3.4.2. GET Request to Return Specific Image Configuration Copy linkLink copied to clipboard!
Request Header
3.3.5. Deleting an Image Copy linkLink copied to clipboard!
3.3.5.1. Request Breakdown Copy linkLink copied to clipboard!
Deleting an Image requires one request:
-
A DELETE request to the
sha256:
-prefixed image hash in theimages
resource.
The DELETE request returns a code: 200
and the Image is deleted.
3.3.5.2. DELETE Request to Delete Image Copy linkLink copied to clipboard!
Request Header
3.4. Image Streams Copy linkLink copied to clipboard!
3.4.1. Description of Resource Copy linkLink copied to clipboard!
An ImageStream stores a mapping of tags to images, metadata overrides that are applied when images are tagged in a stream, and an optional reference to a Docker image repository on a registry.
3.4.2. Creating a New Image Stream Copy linkLink copied to clipboard!
3.4.2.1. Request Breakdown Copy linkLink copied to clipboard!
Creating a new image stream requires one request:
-
A POST request to the
imagestreams
subresource of the namespace.
The POST request uses an ImageStream
configuration in the request body.
3.4.2.2. POST Request to Create a New Image Stream Copy linkLink copied to clipboard!
Request Header
Request Body
3.4.3. Importing an Image Stream Copy linkLink copied to clipboard!
3.4.3.1. Request Breakdown Copy linkLink copied to clipboard!
Importing an image stream requires one request:
-
A POST request to the
imagestreamimports
subresource of the namespace.
The POST request uses an ImageStreamImport
configuration in the request body.
The following example imports the ruby-23-rhel7:latest
image into a namespace as a custom imagestream.
3.4.3.2. POST Request to Create a New Image Stream Copy linkLink copied to clipboard!
Request Header
Request Body
3.4.4. Listing All Image Streams in a Cluster Copy linkLink copied to clipboard!
3.4.4.1. Request Breakdown Copy linkLink copied to clipboard!
Listing all the image streams in a cluster requires one request:
-
A GET request to the
imagestreams
resource.
The GET request returns the ImageStreamList
, listing the details of all image streams in the cluster.
3.4.4.2. GET Request to Return All Image Streams in a Cluster Copy linkLink copied to clipboard!
Request Header
3.4.5. Listing all Image Streams in a Namespace Copy linkLink copied to clipboard!
3.4.5.1. Request Breakdown Copy linkLink copied to clipboard!
Listing all the image streams in a namespace requires one request:
-
A GET request to the
imagestreams
subresource of the namespace.
The GET request returns the ImageStreamList
, listing the details of all image streams in the namespace.
3.4.5.2. GET Request to Return Image Streams in Namespace Copy linkLink copied to clipboard!
Request Header
3.4.6. Listing a Specific Image Stream Configuration Copy linkLink copied to clipboard!
3.4.6.1. Request Breakdown Copy linkLink copied to clipboard!
Listing a specific image stream configuration requires one request:
-
A GET request to the image stream name in the
imagestreams
subresource of the namespace.
The GET request returns the ImageStream
configuration for the specified image stream.
3.4.6.2. GET Request to Return Specific Image Stream Configuration Copy linkLink copied to clipboard!
Request Header
3.4.7. Deleting an Image Stream Copy linkLink copied to clipboard!
3.4.7.1. Request Breakdown Copy linkLink copied to clipboard!
Deleting a image stream requires one request:
-
A DELETE request to the image stream name in the
imagestreams
subresource of the namespace.
The DELETE request returns a code: 200
and the image stream is deleted.
3.4.7.2. DELETE Request to Delete Image Stream Copy linkLink copied to clipboard!
Request Header
3.5. Image Stream Tags Copy linkLink copied to clipboard!
3.5.1. Description of Resource Copy linkLink copied to clipboard!
An ImageStreamTag represents an Image that is retrieved by tag name from an ImageStream.
3.5.2. Adding an Image Stream Tag Copy linkLink copied to clipboard!
3.5.2.1. Request Breakdown Copy linkLink copied to clipboard!
Adding a tag to an image stream requires one request:
-
A PUT request to the image stream tag name in the
imagestreamtags
subresource of the namespace.
The PUT request uses an ImageStreamTag
configuration in the request body.
The following example adds an image stream tag to the default ruby
image stream in the openshift
namespace.
3.5.2.2. PUT Request to Add an Image Stream Tag Copy linkLink copied to clipboard!
Request Header
Request Body
3.5.3. Deleting an Image Stream Tag Copy linkLink copied to clipboard!
3.5.3.1. Request Breakdown Copy linkLink copied to clipboard!
Deleting an image stream tag requires one request:
-
A DELETE request to the image stream tag name in the
imagestreamtags
subresource of the namespace.
The DELETE request returns a code: 200
and the image stream tag is deleted.
The following example deletes the image stream tag, added in the previous example, from the default ruby
image stream in the openshift
namespace.
3.5.3.2. DELETE Request to Delete Image Stream Tag Copy linkLink copied to clipboard!
Request Header