GoogleContainerTools/skaffold · error
INIT_DOCKER_NETWORK_CONTAINER_DOES_NOT_EXIST
INIT_DOCKER_NETWORK_CONTAINER_DOES_NOT_EXIST
Error message
container '%s' not found, required by image '%s' for docker network stack sharing
What it means
When a Docker build artifact uses network mode `container:<id|name>` (stack sharing), Skaffold validates at schema-validation time that the referenced container actually exists and is running by querying the Docker daemon. If the daemon cannot find a container with that id/name (and no name matches "/<id>" in its inspect output), this actionable error is raised.
Source
Thrown at pkg/skaffold/schema/validation/validation.go:462
},
},
}))
return errs
}
for _, c := range containers.Items {
// Comparing ID seeking for <id>
if strings.HasPrefix(c.ID, id) {
return errs
}
for _, name := range c.Names {
// c.Names come in form "/<name>"
if name == "/"+id {
return errs
}
}
}
errMsg := fmt.Sprintf("container '%s' not found, required by image '%s' for docker network stack sharing", id, a.ImageName)
errs = append(errs, sErrors.NewError(errors.New(errMsg),
&proto.ActionableErr{
Message: errMsg,
ErrCode: proto.StatusCode_INIT_DOCKER_NETWORK_CONTAINER_DOES_NOT_EXIST,
Suggestions: []*proto.Suggestion{
{
SuggestionCode: proto.SuggestionCode_CHECK_DOCKER_NETWORK_CONTAINER_RUNNING,
Action: "Please fix the docker network container name and try again.",
},
},
}))
}
}
return errs
}
// validateCustomDependencies makes sure that dependencies.ignore is only used in conjunction with dependencies.paths
func validateCustomDependencies(cfg *parser.SkaffoldConfigEntry, artifacts []*latest.Artifact) (cfgErrs []ErrorWithLocation) {
for i, a := range artifacts {View on GitHub (pinned to a1189de023)
Solutions
- Start the referenced container (`docker start <name>`) or run it (`docker run -d --name <name> ...`) before building.
- Verify the container exists with `docker ps | grep <name>` on the same DOCKER_HOST Skaffold uses.
- If the shared stack is unnecessary, change network mode to `bridge` or `default` in the artifact's docker build config.
- Correct any typo in the container id/name in the network mode string.
Example fix
# before (skaffold.yaml artifact build args) docker: network: container:helper-nginx # after (ensure helper exists, or switch mode) docker: network: bridge
Defensive patterns
Strategy: validation
Validate before calling
const name = 'helper-nginx';
execSync(`docker ps --filter name=^/${name}$ --format '{{.Names}}'`, { stdio: 'pipe' }); // throws if not running Prevention
- Ensure dependency containers are started before skaffold build/dev
- Confirm DOCKER_HOST matches where the shared container runs
- Prefer named containers with restart policies for build-time dependencies
When it happens
Trigger: Building with `artifact.defaults.buildArgs` or docker build config setting `network: container:foo` while no running container named foo exists; referencing a container from a different Docker context (DOCKER_HOST); the dependency container stopped or was removed before `skaffold build/dev` ran.
Common situations: CI environments where the helper container was torn down; Docker Desktop restart wiping one-off containers; using a name valid on the local machine but not on the remote DOCKER_HOST; typos in the container name.
Related errors
- %q running container image %q errored during run with status
- docker deployment not supported alongside cluster deployment
- executing build: %w
- executing build: %w
- failed to build: %w
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/e14f9a9d5cc5fae4.
Report an issue: GitHub.