Build and Push an Image to Docker Registry Step Settings

Updated 2 weeks ago by Michael Cretzman

This topic provides settings for the Build and Push an Image to Docker Registry step.

This step creates a Docker image from a Dockerfile and pushes it to a Docker registry.

The step is the equivalent to the docker build command.

In this topic:

Name

The unique name for this step.

Docker Connector

Harness Connector to docker to use for uploading the image.

Docker Repository

The name of the Repository. For example, <hub-user>/<repo-name>:<tag>.

When using private Docker registries, use a fully qualified repo name.

Tags

Docker build tag (-t).

Each tag should added separately.

Optimize

Enables this option to redo snapshot mode.

Dockerfile

The name of the Dockerfile. If you do not provide a name, Harness assumes the Dockerfile is in the root folder of the codebase.

Context

Context represents a directory containing a Dockerfile which kaniko will use to build your image.

For example, COPY command in your Dockerfile should refer to a file in the build context.

Labels

Docker object labels to add metadata to the Docker image.

Build Arguments

The Docker build-time variables (--build-arg).

Target

The Docker target build stage (--target).

For example, build-env.

Remote Cache Repository

Enter the Cache repo name.

The Remote Cache Repository must be already created in the same account and organization as the build image. The entered repository name must exist for caching to work.

Run as User

Set the value to specify the user id for all processes in the pod, running in containers. See Set the security context for a pod.

Set container resources

Maximum resources limit values for the resources used by the container at runtime.

Limit Memory

Maximum memory that the container can use.

You can express memory as an integer value with one of these suffixes: G, M, Gi, Mi.

Limit CPU

See Resource units in Kubernetes.

Limit the number of cores that the container can use.

Limits for CPU resources are measured in cpu units.

Fractional requests are allowed. The expression 0.1 is equivalent to the expression 100m, that can be read as one hundred millicpu.

Timeout

Timeout for the step. Once the timeout is reached, the step fails, and the Pipeline execution continues.

See Also


Please Provide Feedback