Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
215 views
in Technique[技术] by (71.8m points)

Error initiliazing container job in a Hosted Azure Pipelines

I want to run a skopeo container as a container job.

I keep getting this error message during the Initialize containers step

Error response from daemon: Container 7e741e4aafb30bb89e1dfb830c1cb69fa8d47d219f28cc7b8e57727253632256 is not running

my pipeline looks like this:

  - job: publish_branch_image
    pool:
      vmImage: ubuntu-latest
    container: docker.io/ananace/skopeo:latest
    steps:
    - script: |
        # clean branchname for imagename
        export COMMIT_IMAGE="$(Image.TagName)"
        export TARGET_IMAGE="$(Image.Name)":$(echo $(Build.SourceBranch) | sed 's./.-.g')
        echo "Pushing to ${TARGET_IMAGE}"
        skopeo copy docker://${COMMIT_IMAGE} docker://${TARGET_IMAGE} --src-creds="$(Registry.USER):$(Registry.PASSWORD)" --dest-creds="$(Registry.USER):$(Registry.PASSWORD)"
      displayName: publish-branch-release-image


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

According to the error message, it seems that the container is not running, we could run the cmd docker pull docker.io/ananace/skopeo:latest to pull the image and run it via docker run docker.io/ananace/skopeo:latest, then we could use it.

Update1

Thanks for michiel sharing, according to the doc Endpoints and Linux-based containers:

Containers can be hosted on registries other than Docker Hub. To host an image on Azure Container Registry or another private container registry, add a service connection to the private registry. Then you can reference it in a container spec:

container:
  image: xxx/xxx:tag
  endpoint: xxx

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...