You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### What are the expected values for Container Registry and Image
2
+
3
+
For **Container Registry** settings, provide a Harness container registry connector, such as a [Docker connector](/docs/platform/connectors/cloud-providers/ref-cloud-providers/docker-registry-connector-settings-reference/), that connects to a container registry, such as Docker Hub, where the **Image** is located.
4
+
5
+
For **Image**, provide the FQN (fully-qualified name) or artifact name and tag of the Docker image to use when this step runs commands, for example `us-docker.pkg.dev/gar-prod-setup/harness-public/harness/cache:latest` or `maven:3.8-jdk-11`. If you don't include a tag, Harness uses the `latest` tag. Depending on the connector and feature flags set, **an FQN may be required**.
6
+
7
+
You can use any Docker image from any Docker registry, including Docker images from private registries. Different container registries require different name formats, for example:
8
+
9
+
***Docker Registry:** Input the name of the artifact you want to deploy, such as `library/tomcat`. Wildcards aren't supported. FQN is required for images in private container registries.
10
+
***ECR:** Input the FQN of the artifact you want to deploy. Images in repos must reference a path, for example: `40000005317.dkr.ecr.us-east-1.amazonaws.com/todolist:0.2`.
11
+
***GAR:** Input the FQN of the artifact you want to deploy. Images in repos must reference a path starting with the project ID that the artifact is in, for example: `us-docker.pkg.dev/gar-prod-setup/harness-public/harness/cache:latest`.
12
+
13
+

14
+
<figcaption>Configuring a Container Registry and Image settings.</figcaption>
15
+
16
+
:::note Remove FQN Requirement
17
+
Customers who want to utilize non-FQN references for non public Docker-registry connectors will need to contact Harness Support to add the feature flags, `CI_REMOVE_FQN_DEPENDENCY_FOR_PRIVATE_REGISTRY_CONNECTOR_DOCKER` and `CI_REMOVE_FQN_DEPENDENCY`.
18
+
:::
19
+
20
+
#### Pulling images from JFrog Artifactory Docker registries
21
+
22
+
If you need to pull images from a JFrog Artifactory Docker registry, create a Docker connector that connects to your JFrog instance. **Don't use the Harness Artifactory connector** - The Artifactory connector only supports JFrog non-Docker registries.
23
+
24
+
To create a Docker connector for a JFrog Docker registry:
25
+
26
+
1. Go to **Connectors** in your Harness project, organization, or account resources, and select **New Connector**.
27
+
2. Select **Docker Registry** under **Artifact Repositories**.
28
+
3. Enter a **Name** for the connector. The **Description** and **Tags** are optional.
29
+
4. For **Provider Type**, Select **Other**.
30
+
5. In **Docker Registry URL**, enter your JFrog URL, such as `https://mycompany.jfrog.io`.
31
+
6. In the **Authentication** settings, you must use **Username and Password** authentication.
32
+
***Username:** Enter your JFrog username.
33
+
***Password:** Select or create a [Harness text secret](/docs/platform/secrets/add-use-text-secrets) containing the password corresponding with the **Username**.
34
+
7. Complete any other settings and save the connector. For information all Docker Registry connector settings, go to the [Docker connector settings reference](/docs/platform/connectors/cloud-providers/ref-cloud-providers/docker-registry-connector-settings-reference).
35
+
36
+
37
+
One completed, please remember to use the FQN location of the image unless you have set the [appropriate feature flags as listed above](#what-are-the-expected-values-for-container-registry-and-image)
38
+
39
+
:::tip JFrog URLs
40
+
The JFrog URL format depends on your Artifactory configuration, and whether your Artifactory instance is local, virtual, remote, or behind a proxy. To get your JFrog URL, you can select your repo in your JFrog instance, select **Set Me Up**, and get the repository URL from the server name in the `docker-login` command.
For more information, go to the JFrog documentation on [Repository Management](https://www.jfrog.com/confluence/display/JFROG/Repository+Management) and [Configuring Docker Repositories](https://www.jfrog.com/confluence/display/RTF/Docker+Registry#DockerRegistry-ConfiguringDockerRepositories).
#### When are Container Registry and Image required?
2
+
3
+
The stage's build infrastructure determines whether these fields are required or optional:
4
+
5
+
*[Kubernetes cluster build infrastructure](/docs/continuous-integration/use-ci/set-up-build-infrastructure/k8s-build-infrastructure/set-up-a-kubernetes-cluster-build-infrastructure.md): **Container Registry** and **Image** are always required.
6
+
*[Local runner build infrastructure](/docs/continuous-integration/use-ci/set-up-build-infrastructure/define-a-docker-build-infrastructure.md): **Run Tests** steps can use binaries available on the host machine. The **Container Registry** and **Image** are required if the machine doesn't have the binaries you need.
7
+
*[Self-managed AWS/GCP/Azure VM build infrastructure](/docs/category/set-up-vm-build-infrastructures): **Run Tests** steps can use binaries that you've made available on your build VMs. The **Container Registry** and **Image** are required if the VM doesn't have the necessary binaries. These fields are located under **Additional Configuration** for stages that use self-managed VM build infrastructure.
8
+
*[Harness Cloud build infrastructure](/docs/continuous-integration/use-ci/set-up-build-infrastructure/use-harness-cloud-build-infrastructure.md): **Run Tests** steps can use binaries available on Harness Cloud machines, as described in the [image specifications](/docs/continuous-integration/use-ci/set-up-build-infrastructure/use-harness-cloud-build-infrastructure#platforms-and-image-specifications). The **Container Registry** and **Image** are required if the machine doesn't have the binaries you need. These fields are located under **Additional Configuration** for stages that use Harness Cloud build infrastructure.
Copy file name to clipboardExpand all lines: docs/continuous-integration/use-ci/codebase-configuration/scm-status-checks.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ redirect_from:
10
10
11
11
import Tabs from '@theme/Tabs';
12
12
import TabItem from '@theme/TabItem';
13
+
import WhenReq from '/docs/continuous-integration/shared/imageregistry-whenreq.md';
14
+
import FQNImage from '/docs/continuous-integration/shared/imageregistry-imagesfqn.md';
13
15
14
16
If your pipelines use [webhook triggers](/docs/platform/triggers/triggering-pipelines), you can get [Harness build statuses in your PRs](#pipeline-links-in-prs). However, you must configure your protection rules *in your SCM provider* if you want failed/running builds to block PR merges.
15
17
@@ -52,10 +54,10 @@ These steps explain how to add a status check that uses the GitHub API. For info
52
54
2. Create [GitHub Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) to use for authentication, and save the token as a [Harness text secret](/docs/platform/secrets/add-use-text-secrets).
53
55
3. Add a [Run step](../run-step-settings.md) to your **Build** (`CI`) stage.
54
56
4. Enter a **Name** for the step.
55
-
5. If required by your build infrastructure, provide the **Container Registry** and **Image**.
57
+
5. If required by your build infrastructure, provide the **Container Registry** and **Image**. For more information on how to set this up, please [look at the section below about Container Registry and Image](#container-registry-and-image)
56
58
***Container Registry** is a container registry connector, such as a Docker connector.
57
59
***Image** is the FQN or artifact name and tag of a Docker image that has cURL installed, such as `curlimages/curl:latest` for the [official cURL Docker Hub image](https://hub.docker.com/r/curlimages/curl).
58
-
* To learn more about this setting and when it is required, go to [Use Run steps - Container Registry and Image](../run-step-settings.md#container-registry-and-image).
60
+
* To learn more about this setting and when it is required, [look at the section below about Container Registry and Image](#container-registry-and-image)
59
61
6. For **Shell**, select **Sh**.
60
62
7. In **Command**, enter a script that calls the GitHub API, for example:
61
63
@@ -167,6 +169,14 @@ You can package your status check script in a [custom plugin](../use-drone-plugi
167
169
</TabItem>
168
170
</Tabs>
169
171
172
+
### Container Registry and Image
173
+
174
+
The build environment must have the necessary binaries for the **SCM Status Checks**. Depending on the stage's build infrastructure, **SCM Status Checks** steps can use binaries that exist in the build environment, or use **Container Registry** and **Image** to pull an image, such as a public or private Docker image, that contains the required binaries.
175
+
176
+
<WhenReq />
177
+
178
+
<FQNImage />
179
+
170
180
## Troubleshoot status checks
171
181
172
182
Go to the [Harness CI Knowledge Base](/kb/continuous-integration/continuous-integration-faqs) for common questions and issues related to codebases and SCM status checks, such as:
Copy file name to clipboardExpand all lines: docs/continuous-integration/use-ci/manage-dependencies/background-step-settings.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,8 @@ redirect_from:
13
13
14
14
import Tabs from '@theme/Tabs';
15
15
import TabItem from '@theme/TabItem';
16
-
16
+
import WhenReq from '/docs/continuous-integration/shared/imageregistry-whenreq.md';
17
+
import FQNImage from '/docs/continuous-integration/shared/imageregistry-imagesfqn.md';
17
18
18
19
Use Background steps to [manage dependent services](./dependency-mgmt-strategies.md) that need to run for the entire lifetime of a Build stage. For example, you can set up your pipeline to run multiple background services that implement a local, multi-service app.
19
20
@@ -57,13 +58,11 @@ If the Background step runs directly on the host or in a Kubernetes cluster buil
57
58
58
59
## Container Registry and Image
59
60
60
-
**Container Registry**is a Harness container registry connector that connects to the container registry, such as Docker Hub, from which you want Harness to pull an image.
61
+
The build environment must have the necessary binaries for the **Background**step to execute your test commands. Depending on the stage's build infrastructure, **Background** steps can use binaries that exist in the build environment, or use **Container Registry** and **Image**to pull an image, such as a public or private Docker image, that contains the required binaries.
61
62
62
-
**Image** is the container image to use for the background service. The image name should include the tag, or it defaults to the `latest` tag if unspecified. You can use any Docker image from any Docker registry, including Docker images from private registries. Different container registries require different name formats:
63
+
<WhenReq />
63
64
64
-
***Docker Registry:** Input the name of the artifact you want to deploy, such as `library/tomcat`. Wildcards aren't supported. FQN is required for images in private container registries.
65
-
***ECR:** Input the FQN (fully-qualified name) of the artifact you want to deploy. Images in repos must reference a path, for example: `40000005317.dkr.ecr.us-east-1.amazonaws.com/todolist:0.2`.
66
-
***GAR:** Input the FQN (fully-qualified name) of the artifact you want to deploy. Images in repos must reference a path starting with the project ID that the artifact is in, for example: `us-docker.pkg.dev/gar-prod-setup/harness-public/harness/cache:latest`.
import WhenReq from '/docs/continuous-integration/shared/imageregistry-whenreq.md';
17
+
import FQNImage from '/docs/continuous-integration/shared/imageregistry-imagesfqn.md';
16
18
17
19
CI pipelines that use a [Kubernetes cluster build infrastructure](/docs/category/set-up-kubernetes-cluster-build-infrastructures) need Docker-in-Docker (DinD) if you need to run Docker commands as part of the build process. For example, if you want to build images from [two separate codebases in the same pipeline](/docs/continuous-integration/use-ci/codebase-configuration/clone-and-process-multiple-codebases-in-the-same-pipeline.md): One with a [Build and Push to Docker step](/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-and-push/build-and-push-to-docker-registry.md) and another with Docker commands in a [Run step](/docs/continuous-integration/use-ci/run-step-settings.md).
18
20
@@ -57,8 +59,8 @@ To demonstrate how to set up DinD in Harness CI, this topic creates a pipeline t
57
59
In your **Build** stage, select the **Execution** tab, and add a [Background step](./background-step-settings.md) configured as follows:
58
60
59
61
1. For **Name**, enter `dind_Service`.
60
-
2. For **Container Registry**, select your [Docker connector](/docs/platform/connectors/cloud-providers/ref-cloud-providers/docker-registry-connector-settings-reference).
61
-
3. For **Image**, enter the name and tag for the image that you want to use to run DinD, such as [docker:dind](https://hub.docker.com/_/docker).
62
+
2. For **Container Registry**, select your [Docker connector](/docs/platform/connectors/cloud-providers/ref-cloud-providers/docker-registry-connector-settings-reference).
63
+
3. For **Image**, enter the name and tag for the image that you want to use to run DinD, such as [docker:dind](https://hub.docker.com/_/docker). In some cases, an FQN may be necessary. More information can be found below [about setting up the registry and image](#container-registry-and-image).
62
64
4. Under **Additional Configuration**, select **Privileged**. [Privileged mode is required](#privileged-mode-required) Docker-in-Docker to run correctly.
63
65
5. In **Entry Point**, you can provide a list of arguments, if needed. For example, the entry point for the `docker:dind` image is `docker-entrypoint.sh`. If you want to add a `--mtu` argument, you would include both the image entry point and the additional argument in the **Entry Point** specification.
64
66
@@ -87,7 +89,7 @@ After the **Background** step, add a **Run** step to run your Docker commands. C
87
89
88
90
1. Enter a **Name**.
89
91
2. For **Container Registry**, select your [Docker connector](/docs/platform/connectors/cloud-providers/ref-cloud-providers/docker-registry-connector-settings-reference).
90
-
3. For **Image**, enter the name and tag for the Docker image, with the Docker binary, that you want to use to execute the content of **Command**.
92
+
3. For **Image**, enter the name and tag for the Docker image, with the Docker binary, that you want to use to execute the content of **Command**. In some cases, an FQN may be necessary. More information can be found below [about setting up the registry and image](#container-registry-and-image).
91
93
4. In **Command**, enter the shell commands you want to run in this step.
92
94
93
95
For example, the following commands clone a Git repo, build an image, and push the image to a Docker registry:
@@ -132,6 +134,15 @@ You can also add steps to your pipeline that [run health checks on background se
132
134
133
135
When you run your pipeline, you can review the step logs on the [Build details page](../viewing-builds.md).
134
136
137
+
### Container Registry and Image
138
+
139
+
The build environment must have the necessary binaries for the **DinD** step. Depending on the stage's build infrastructure, **DinD** steps can use binaries that exist in the build environment, or use **Container Registry** and **Image** to pull an image, such as a public or private Docker image, that contains the required binaries.
140
+
141
+
<WhenReq />
142
+
143
+
<FQNImage />
144
+
145
+
135
146
## Pipeline YAML example
136
147
137
148
The following YAML example defines a pipeline that:
Copy file name to clipboardExpand all lines: docs/continuous-integration/use-ci/run-step-settings.md
+2-50Lines changed: 2 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ import Tabs from '@theme/Tabs';
16
16
import TabItem from '@theme/TabItem';
17
17
import EnhancedOutVar from '/docs/continuous-integration/shared/enhanced-output-variables.md';
18
18
import OutVar from '/docs/continuous-integration/shared/output-var.md';
19
+
import FQNImage from '/docs/continuous-integration/shared/imageregistry-imagesfqn.md';
19
20
20
21
You can use a **Run** step to run commands or scripts in a CI pipeline. Here are some examples of different ways you can use **Run** steps.
21
22
@@ -251,56 +252,7 @@ The stage's build infrastructure determines whether these fields are required or
251
252
252
253
</details>
253
254
254
-
<details>
255
-
<summary>What are the expected values for Container Registry and Image?</summary>
256
-
257
-
For **Container Registry**, provide a Harness container registry connector, such as a [Docker connector](/docs/platform/connectors/cloud-providers/ref-cloud-providers/docker-registry-connector-settings-reference/), that connects to a container registry, such as Docker Hub, where the **Image** is located.
258
-
259
-
For **Image**, provide the FQN (fully-qualified name) or artifact name and tag of the Docker image to use when this step runs commands, for example `us-docker.pkg.dev/gar-prod-setup/harness-public/harness/cache:latest` or `maven:3.8-jdk-11`. If you don't include a tag, Harness uses the `latest` tag.
260
-
261
-
You can use any Docker image from any Docker registry, including Docker images from private registries. Different container registries require different name formats, for example:
262
-
263
-
* **Docker Registry:** Input the name of the artifact you want to deploy, such as `library/tomcat`. Wildcards aren't supported. FQN is required for images in private container registries.
264
-
* **ECR:** Input the FQN of the artifact you want to deploy. Images in repos must reference a path, for example: `40000005317.dkr.ecr.us-east-1.amazonaws.com/todolist:0.2`.
265
-
* **GAR:** Input the FQN of the artifact you want to deploy. Images in repos must reference a path starting with the project ID that the artifact is in, for example: `us-docker.pkg.dev/gar-prod-setup/harness-public/harness/cache:latest`.
266
-
267
-
<figure>
268
-
269
-

270
-
271
-
<figcaption>Configuring a Container Registry and Image settings.</figcaption>
272
-
</figure>
273
-
274
-
</details>
275
-
276
-
<details>
277
-
<summary>Pulling images from JFrog Artifactory Docker registries</summary>
278
-
279
-
If you need to pull images from a JFrog Artifactory Docker registry, create a Docker connector that connects to your JFrog instance. **Don't use the Harness Artifactory connector** - The Artifactory connector only supports JFrog non-Docker registries.
280
-
281
-
To create a Docker connector for a JFrog Docker registry:
282
-
283
-
1. Go to **Connectors** in your Harness project, organization, or account resources, and select **New Connector**.
284
-
2. Select **Docker Registry** under **Artifact Repositories**.
285
-
3. Enter a **Name** for the connector. The **Description** and **Tags** are optional.
286
-
4. For **Provider Type**, Select **Other**.
287
-
5. In **Docker Registry URL**, enter your JFrog URL, such as `https://mycompany.jfrog.io`.
288
-
6. In the **Authentication** settings, you must use **Username and Password** authentication.
289
-
* **Username:** Enter your JFrog username.
290
-
* **Password:** Select or create a [Harness text secret](/docs/platform/secrets/add-use-text-secrets) containing the password corresponding with the **Username**.
291
-
7. Complete any other settings and save the connector. For information all Docker Registry connector settings, go to the [Docker connector settings reference](/docs/platform/connectors/cloud-providers/ref-cloud-providers/docker-registry-connector-settings-reference).
292
-
293
-
:::tip JFrog URLs
294
-
295
-
The JFrog URL format depends on your Artifactory configuration, and whether your Artifactory instance is local, virtual, remote, or behind a proxy. To get your JFrog URL, you can select your repo in your JFrog instance, select **Set Me Up**, and get the repository URL from the server name in the `docker-login` command.
For more information, go to the JFrog documentation on [Repository Management](https://www.jfrog.com/confluence/display/JFROG/Repository+Management) and [Configuring Docker Repositories](https://www.jfrog.com/confluence/display/RTF/Docker+Registry#DockerRegistry-ConfiguringDockerRepositories).
0 commit comments