Answers: <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>
  
Answers: CC BY-SA 4.0
Answers: 2023-03-06T18:10:59.463Z
Answers: 2023-03-06T18:17:25.423Z
Answers: 2023-03-06T18:17:25.423Z
Answers: Shamrai Aleksander
Answers: <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>
  
Answers: CC BY-SA 4.0
Answers: 2023-08-11T17:07:43.527Z
Answers: 2023-08-11T17:07:43.527Z
Answers: Matthew Robertson
Answers: <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>
  
Answers: CC BY-SA 4.0
Answers: 2023-07-13T10:23:05.587Z
Answers: 2023-07-13T10:23:05.587Z
Answers: Harry Huy
Body: <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>
  
Tags: <docker><azure-devops><docker-registry><artifacts>
Title: Azure Devops pipeline not listing artifact created by it
UserDisplayName: Oskar Persson
ThreadText: # 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:
  
  [![Screenshot of executed pipeline in DevOps showing "0 work items" below the Related section](https://i.sstatic.net/vvKdL.png)](https://i.sstatic.net/vvKdL.png)
  
  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](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/docker-v2).
  
  ```yaml
  # 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: '<my connection>'
    imageRepository: '<my repo>'
    containerRegistry: '<my registry>'
    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
  
  username_1 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.
  
  
  ---
  
  