{"record":{"id":"c6985414c9e43466","repo":"testcontainers/testcontainers-java","slug":"your-docker-daemon-is-running-the-lxc-driver-which-doesn-t","errorCode":null,"errorMessage":"Your docker daemon is running the \"lxc\" driver, which doesn't support \"docker exec\".","messagePattern":"Your docker daemon is running the \"lxc\" driver, which doesn't support \"docker exec\"\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/testcontainers/containers/ExecInContainerPattern.java","lineNumber":190,"sourceCode":"     * driver. At the time of writing, CircleCI was using this driver.\n     * @param dockerClient the {@link DockerClient}\n     * @param containerInfo the container info\n     * @param outputCharset the character set used to interpret the output.\n     * @param execConfig the exec configuration\n     * @return the result of execution\n     * @throws IOException if there's an issue communicating with Docker\n     * @throws InterruptedException if the thread waiting for the response is interrupted\n     * @throws UnsupportedOperationException if the docker daemon you're connecting to doesn't support \"exec\".\n     */\n    public Container.ExecResult execInContainer(\n        DockerClient dockerClient,\n        InspectContainerResponse containerInfo,\n        Charset outputCharset,\n        ExecConfig execConfig\n    ) throws UnsupportedOperationException, IOException, InterruptedException {\n        if (!TestEnvironment.dockerExecutionDriverSupportsExec()) {\n            // at time of writing, this is the expected result in CircleCI.\n            throw new UnsupportedOperationException(\n                \"Your docker daemon is running the \\\"lxc\\\" driver, which doesn't support \\\"docker exec\\\".\"\n            );\n        }\n\n        if (!isRunning(containerInfo)) {\n            throw new IllegalStateException(\"execInContainer can only be used while the Container is running\");\n        }\n\n        String containerId = containerInfo.getId();\n        String containerName = containerInfo.getName();\n\n        String[] command = execConfig.getCommand();\n        log.debug(\"{}: Running \\\"exec\\\" command: {}\", containerName, String.join(\" \", command));\n        final ExecCreateCmd execCreateCmd = dockerClient\n            .execCreateCmd(containerId)\n            .withAttachStdout(true)\n            .withAttachStderr(true)\n            .withCmd(command);","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/core/src/main/java/org/testcontainers/containers/ExecInContainerPattern.java#L172-L208","documentation":"execInContainer requires the Docker daemon's exec capability. TestEnvironment.dockerExecutionDriverSupportsExec() returns false when the daemon uses the legacy lxc execution driver, so the method throws UnsupportedOperationException before attempting exec.","triggerScenarios":"Calling execInContainer(...) (directly or via container.execInContainer) against an old Docker daemon configured with the lxc execution driver, as historically seen on CircleCI.","commonSituations":"Legacy CI environments (old CircleCI images), Docker < 1.10 with lxc as the default exec driver, custom daemon configs with --exec-driver=lxc.","solutions":["Upgrade the Docker daemon / CI image to a version using libcontainer (native exec driver)","Change the daemon's exec driver configuration away from lxc","Replace execInContainer with copyFileToContainer of an entrypoint script if the environment cannot be changed","Run tests on a different executor that provides a modern Docker daemon"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!TestEnvironment.dockerExecutionDriverSupportsExec()) { throw new AssumptionViolatedException(\"docker exec unsupported (lxc driver); skipping exec-based tests\"); }","typeGuard":null,"tryCatchPattern":"try { container.execInContainer(\"cmd\"); } catch (UnsupportedOperationException e) { if (e.getMessage().contains(\"lxc\")) { throw new AssumptionViolatedException(\"environment lacks docker exec support\"); } throw e; }","preventionTips":["Use CI images with modern Docker (libcontainer/native exec driver)","Check TestEnvironment.dockerExecutionDriverSupportsExec() in test setup and skip gracefully","Avoid legacy lxc-based runners for integration tests"],"tags":["docker-exec","lxc","unsupported-platform","docker-daemon"],"backgroundTag":"unsupported-platform","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"}