{"record":{"id":"bdfde71e91c1b2ce","repo":"testcontainers/testcontainers-java","slug":"can-t-get-docker-image-image","errorCode":null,"errorMessage":"Can't get Docker image: ${image}","messagePattern":"Can't get Docker image: (.+?)","errorType":"exception","errorClass":"ContainerFetchException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/testcontainers/containers/GenericContainer.java","lineNumber":1308,"sourceCode":"\n    /**\n     * {@inheritDoc}\n     */\n    @Override\n    public void setDockerImageName(@NonNull String dockerImageName) {\n        this.image = new RemoteDockerImage(dockerImageName);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    @Override\n    @NonNull\n    public String getDockerImageName() {\n        try {\n            return image.get();\n        } catch (Exception e) {\n            throw new ContainerFetchException(\"Can't get Docker image: \" + image, e);\n        }\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    @Override\n    @Deprecated\n    public String getTestHostIpAddress() {\n        if (DockerMachineClient.instance().isInstalled()) {\n            try {\n                Optional<String> defaultMachine = DockerMachineClient.instance().getDefaultMachine();\n                if (!defaultMachine.isPresent()) {\n                    throw new IllegalStateException(\"Could not find a default docker-machine instance\");\n                }\n\n                String sshConnectionString = CommandLine\n                    .runShellCommand(\"docker-machine\", \"ssh\", defaultMachine.get(), \"echo $SSH_CONNECTION\")","sourceCodeStart":1290,"sourceCodeEnd":1326,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/core/src/main/java/org/testcontainers/containers/GenericContainer.java#L1290-L1326","documentation":"getDockerImageName resolves the configured RemoteDockerImage, which may pull the image from a registry. Any failure during that resolution (network error, missing image/tag, registry auth) is wrapped in ContainerFetchException. It fires when the image cannot actually be fetched, not when the name string is malformed.","triggerScenarios":"Thrown at core/src/main/java/org/testcontainers/containers/GenericContainer.java:1308 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the image name and tag exist in the registry","Check network connectivity and registry authentication","Pre-pull the image before running tests","Inspect the wrapped cause for the root failure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8e549514e3f01c57d70546fbb8599d138f3903e5","analyzedAt":"2026-09-12T14:56:41.227Z","contentChangedAt":"2026-09-12T14:56:41.227Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}