最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

building a docker image and use it directly without push in azure dev ops - Stack Overflow

programmeradmin1浏览0评论

In a azure pipeline I have two steps:

  • The first step is to build a Docker image (which provides a cross compile environment)

  • Second step is to build

    steps:
        - checkout: self
          clean: true
    
    - task: DockerInstaller@0
      displayName: Docker Installer
      inputs:
        dockerVersion: '17.09.0-ce'
        releaseType: stable
    
    - bash: |
        docker -t my_image -f path/to/Dockerfile .
      displayName: "Build docker image"
    
    - bash: |
        docker run -ti my_image <some_build_command>
      displayName: "Build application"
    

The log output looks like:

Resolving "my_image" using unqualified-search registries (/etc/containers/registries.conf)
Trying to pull docker.io/library/my_image:latest...
Trying to pull quay.io/my_image:latest...
Error: 2 errors occurred while pulling:
 * initializing source docker://my_image:latest: reading manifest latest in docker.io/library/my_image: errors:
denied: requested access to the resource is denied
unauthorized: authentication required

 * initializing source docker://quay.io/my_image:latest: reading manifest latest in quay.io/pm-linux-arm64: StatusCode: 404, <!doctype html>
<html lang=en>
<title>404 Not Foun...

I seems that the worker ignores my docker image. When doing a 'docker images' before build command it outputs my_image as part of the local docker registry

Does anyone has an idea?

In a azure pipeline I have two steps:

  • The first step is to build a Docker image (which provides a cross compile environment)

  • Second step is to build

    steps:
        - checkout: self
          clean: true
    
    - task: DockerInstaller@0
      displayName: Docker Installer
      inputs:
        dockerVersion: '17.09.0-ce'
        releaseType: stable
    
    - bash: |
        docker -t my_image -f path/to/Dockerfile .
      displayName: "Build docker image"
    
    - bash: |
        docker run -ti my_image <some_build_command>
      displayName: "Build application"
    

The log output looks like:

Resolving "my_image" using unqualified-search registries (/etc/containers/registries.conf)
Trying to pull docker.io/library/my_image:latest...
Trying to pull quay.io/my_image:latest...
Error: 2 errors occurred while pulling:
 * initializing source docker://my_image:latest: reading manifest latest in docker.io/library/my_image: errors:
denied: requested access to the resource is denied
unauthorized: authentication required

 * initializing source docker://quay.io/my_image:latest: reading manifest latest in quay.io/pm-linux-arm64: StatusCode: 404, <!doctype html>
<html lang=en>
<title>404 Not Foun...

I seems that the worker ignores my docker image. When doing a 'docker images' before build command it outputs my_image as part of the local docker registry

Does anyone has an idea?

Share Improve this question asked Nov 18, 2024 at 18:15 MarkaRagnos0815MarkaRagnos0815 2104 silver badges15 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

adding "--pull never" in docker run command solved the issue

EDIT: there was a second Problem under the hood. The Docker I am building produces a shell script to run commands using this image. The script is detecting the container-rizer app and selected podman instead of docker. podman did not find the image because it was build using docker .

发布评论

评论列表(0)

  1. 暂无评论