{"record":{"id":"e14f9a9d5cc5fae4","repo":"GoogleContainerTools/skaffold","slug":"init-docker-network-container-does-not-exist","errorCode":"INIT_DOCKER_NETWORK_CONTAINER_DOES_NOT_EXIST","errorMessage":"container '%s' not found, required by image '%s' for docker network stack sharing","messagePattern":"container '(.+?)' not found, required by image '(.+?)' for docker network stack sharing","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/validation/validation.go","lineNumber":462,"sourceCode":"\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t}))\n\t\t\t\treturn errs\n\t\t\t}\n\t\t\tfor _, c := range containers.Items {\n\t\t\t\t// Comparing ID seeking for <id>\n\t\t\t\tif strings.HasPrefix(c.ID, id) {\n\t\t\t\t\treturn errs\n\t\t\t\t}\n\t\t\t\tfor _, name := range c.Names {\n\t\t\t\t\t// c.Names come in form \"/<name>\"\n\t\t\t\t\tif name == \"/\"+id {\n\t\t\t\t\t\treturn errs\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\terrMsg := fmt.Sprintf(\"container '%s' not found, required by image '%s' for docker network stack sharing\", id, a.ImageName)\n\t\t\terrs = append(errs, sErrors.NewError(errors.New(errMsg),\n\t\t\t\t&proto.ActionableErr{\n\t\t\t\t\tMessage: errMsg,\n\t\t\t\t\tErrCode: proto.StatusCode_INIT_DOCKER_NETWORK_CONTAINER_DOES_NOT_EXIST,\n\t\t\t\t\tSuggestions: []*proto.Suggestion{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSuggestionCode: proto.SuggestionCode_CHECK_DOCKER_NETWORK_CONTAINER_RUNNING,\n\t\t\t\t\t\t\tAction:         \"Please fix the docker network container name and try again.\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t}\n\t}\n\treturn errs\n}\n\n// validateCustomDependencies makes sure that dependencies.ignore is only used in conjunction with dependencies.paths\nfunc validateCustomDependencies(cfg *parser.SkaffoldConfigEntry, artifacts []*latest.Artifact) (cfgErrs []ErrorWithLocation) {\n\tfor i, a := range artifacts {","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/validation/validation.go#L444-L480","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before (skaffold.yaml artifact build args)\ndocker:\n  network: container:helper-nginx\n# after (ensure helper exists, or switch mode)\ndocker:\n  network: bridge","handlingStrategy":"validation","validationCode":"const name = 'helper-nginx';\nexecSync(`docker ps --filter name=^/${name}$ --format '{{.Names}}'`, { stdio: 'pipe' }); // throws if not running","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["docker","network","skaffold"],"backgroundTag":"docker-container-not-found","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}