Skip to content
Latchkey

Azure Pipelines "Container failed to initialize"

A container job or container resource could not start. The image reference is wrong, the registry pull failed (auth or a transient network blip), or the agent OS does not support that container.

What this error means

A job using a container: resource fails during initialization with Container <name> failed to initialize, often preceded by a docker pull or docker create error. The job never reaches your steps.

Azure DevOps
##[error]Container 'node:18' failed to initialize.
Error response from daemon: pull access denied for myregistry/app,
repository does not exist or may require 'docker login'.

Common causes

Image not found or private registry not authenticated

A misspelled tag or a private image without a configured container registry service connection makes the pull fail, so the container never starts.

Unsupported container/agent combination

Windows container images on a Linux agent (or vice versa), or container jobs on an agent without Docker, cannot initialize.

How to fix it

Authenticate the registry via an endpoint

For private images, reference a Docker registry service connection so the agent can pull.

azure-pipelines.yml
resources:
  containers:
    - container: app
      image: myregistry.azurecr.io/app:1.0
      endpoint: my-acr-connection
jobs:
  - job: build
    container: app

Match the container OS to the agent

  1. Use a Linux image on a Linux (ubuntu-latest) agent and a Windows image on a Windows agent.
  2. Confirm the agent has Docker installed (Microsoft-hosted Linux images do).
  3. Re-run if the failure was a transient registry/network blip - pulls often succeed on retry.

How to prevent it

  • Reference private images through a registry service connection.
  • Match container image OS to the agent pool image.
  • Pin image tags you know exist and are pullable.

Frequently asked questions

What causes ""Container failed to initialize""?
A misspelled tag or a private image without a configured container registry service connection makes the pull fail, so the container never starts.
How do I fix "Container failed to initialize"?
For private images, reference a Docker registry service connection so the agent can pull.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card