<p>You should not see that. Artifact is something published from <a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/publish-build-artifacts-v1?view=azure-pipelines" rel="nofollow noreferrer">PublishBuildArtifacts@1</a> task. In your case, you publish to Docker Container Registry (not to azure build artifacts).</p>
<p>All other items (like tags and new image) you can find through docker cli.</p>

CC BY-SA 4.0
2023-03-06T18:10:59.463Z
2023-03-06T18:17:25.423Z
2023-03-06T18:17:25.423Z
Shamrai Aleksander
<p>Shamrai is correct that the build and push tasks for Docker don't publish an artifact to the pipeline and instead are pushing that artifact to ACR.</p>
<p>If you want to see the artifact in the pipeline you will have to use the PublishBuildArtifacts task.</p>
<p>However, if you only want a link between the build and the image and do not want to store a second copy in the build, you could tag the image with the build id.</p>
<pre><code>- task: Docker@2
        displayName: Push
        inputs:
          command: push
          repository: $(imageRepository)
          dockerfile: $(dockerfilePath)
          containerRegistry: $(dockerRegistryServiceConnection)
          tags: |
            latest
            $(tag)
            $(Build.BuildId)

</code></pre>

CC BY-SA 4.0
2023-08-11T17:07:43.527Z
2023-08-11T17:07:43.527Z
Matthew Robertson
<p>As my experience, Artifact of the Build pipeline in a Docker solution are normally a Docker Compose file, or manifest file... that contains information about the images have been built. Then, in the Release pipeline we can use these files for deploying corresponding images to the server.
You have to pusblish these files as an Artifact by yourself.</p>

CC BY-SA 4.0
2023-07-13T10:23:05.587Z
2023-07-13T10:23:05.587Z
Harry Huy
<p>I am building and pushing Docker images to my Azure Container Registry from Azure DevOps using the <code>azure-pipelines.yml</code> file below.</p>
<p>This works great <strong>except</strong> that there doesn't seem to be any relation created between the created image and the pipeline that created it. There is no artifacts listed on the executed pipeline:</p>
<p><a href="https://i.sstatic.net/vvKdL.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vvKdL.png" alt="Screenshot of executed pipeline in DevOps showing &quot;0 work items&quot; below the Related section" /></a></p>
<p>The artifact is created correctly such that I can use it when running a release pipeline and if I inspect the image locally I can confirm that it has the labels on it created by the Docker task as described <a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/docker-v2" rel="nofollow noreferrer">here</a>.</p>
<pre class="lang-yaml prettyprint-override"><code># Docker
# Build and push an image to Azure Container Registry
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker

trigger:
- none

resources:
- repo: self

variables:
  # Container registry service connection established during pipeline creation
  dockerRegistryServiceConnection: '&lt;my connection&gt;'
  imageRepository: '&lt;my repo&gt;'
  containerRegistry: '&lt;my registry&gt;'
  dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile'
  tag: '$(Build.BuildNumber)'
  DOCKER_BUILDKIT: 1

  # Agent VM image name
  vmImageName: 'ubuntu-latest'

stages:
- stage: Build
  displayName: Build and push stage
  jobs:
  - job: Build
    displayName: Build
    pool:
      vmImage: $(vmImageName)
    steps:
      - task: Docker@2
        displayName: Build
        inputs:
          command: build
          repository: $(imageRepository)
          dockerfile: $(dockerfilePath)
          arguments: '--target prod'
          containerRegistry: $(dockerRegistryServiceConnection)
          tags: |
            latest
            $(tag)
      - task: Docker@2
        displayName: Push
        inputs:
          command: push
          repository: $(imageRepository)
          dockerfile: $(dockerfilePath)
          containerRegistry: $(dockerRegistryServiceConnection)
          tags: |
            latest
            $(tag)
</code></pre>

<docker><azure-devops><docker-registry><artifacts>
Azure Devops pipeline not listing artifact created by it
Oskar Persson
# Azure Devops pipeline not listing artifact created by it

(Asked by: username_0 on 2023-03-06)

I am building and pushing Docker images to my Azure Container Registry from Azure DevOps using the azure-pipelines.yml file below.
This works great except that there doesn't seem to be any relation created between the created image and the pipeline that created it. There is no artifacts listed on the executed pipeline:

The artifact is created correctly such that I can use it when running a release pipeline and if I inspect the image locally I can confirm that it has the labels on it created by the Docker task as described here.
# Docker
# Build and push an image to Azure Container Registry
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker

trigger:
- none

resources:
- repo: self

variables:
  # Container registry service connection established during pipeline creation
  dockerRegistryServiceConnection: ''
  imageRepository: ''
  containerRegistry: ''
  dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile'
  tag: '$(Build.BuildNumber)'
  DOCKER_BUILDKIT: 1

  # Agent VM image name
  vmImageName: 'ubuntu-latest'

stages:
- stage: Build
  displayName: Build and push stage
  jobs:
  - job: Build
    displayName: Build
    pool:
      vmImage: $(vmImageName)
    steps:
      - task: Docker@2
        displayName: Build
        inputs:
          command: build
          repository: $(imageRepository)
          dockerfile: $(dockerfilePath)
          arguments: '--target prod'
          containerRegistry: $(dockerRegistryServiceConnection)
          tags: |
            latest
            $(tag)
      - task: Docker@2
        displayName: Push
        inputs:
          command: push
          repository: $(imageRepository)
          dockerfile: $(dockerfilePath)
          containerRegistry: $(dockerRegistryServiceConnection)
          tags: |
            latest
            $(tag)

**Tags:** docker, azure-devops, docker-registry, artifacts


---

## 3 answers

### Answer by username_1 on 2023-03-06. Score: 0

You should not see that. Artifact is something published from [PublishBuildArtifacts@1](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/publish-build-artifacts-v1?view=azure-pipelines) task. In your case, you publish to Docker Container Registry (not to azure build artifacts).

All other items (like tags and new image) you can find through docker cli.


---

### Answer by username_2 on 2023-08-11. Score: 0

Shamrai is correct that the build and push tasks for Docker don't publish an artifact to the pipeline and instead are pushing that artifact to ACR.
If you want to see the artifact in the pipeline you will have to use the PublishBuildArtifacts task.
However, if you only want a link between the build and the image and do not want to store a second copy in the build, you could tag the image with the build id.
- task: Docker@2
        displayName: Push
        inputs:
          command: push
          repository: $(imageRepository)
          dockerfile: $(dockerfilePath)
          containerRegistry: $(dockerRegistryServiceConnection)
          tags: |
            latest
            $(tag)
            $(Build.BuildId)


---

### Answer by username_3 on 2023-07-13. Score: 0

As my experience, Artifact of the Build pipeline in a Docker solution are normally a Docker Compose file, or manifest file... that contains information about the images have been built. Then, in the Release pipeline we can use these files for deploying corresponding images to the server.
You have to pusblish these files as an Artifact by yourself.


---

