Skip to content

Issue #5 - [BUG] Docker Compose volume mount causes OCI runtime exec failed error #8

@zenocross

Description

@zenocross

Description

When using Docker Compose with volume mounts, executing commands in containers via the terminal fails with "OCI runtime exec failed" error unless the container is force recreated. This is caused by the working directory not being set correctly for docker exec commands.

Current Behavior

  • Docker Compose container deployed with volume mounts
  • User attempts to open terminal/exec into container
  • Error: "OCI runtime exec failed: exec failed: unable to start container process"
  • Only workaround is force recreating container
  • Issue persists until manual intervention

Expected Behavior

  • Docker Compose container deployed with volume mounts
  • User opens terminal successfully
  • Commands execute in correct working directory
  • No OCI runtime errors
  • Consistent behavior with and without volume mounts

Steps to Reproduce

  1. Create Docker Compose application with volume mounts
  2. Deploy the application
  3. Navigate to container terminal
  4. Attempt to execute command or open shell
  5. Receive OCI runtime exec failed error
  6. Force recreate container
  7. Terminal works temporarily

Root Cause

The docker exec command is not setting the working directory (-w flag) when executing commands in containers. When volume mounts change the filesystem structure, docker needs an explicit working directory to execute commands properly.

Proposed Solution

Update the docker exec command to include the working directory flag:

  • Add -w /app (or appropriate path) to docker exec commands
  • Ensure working directory exists in container
  • Handle cases where working directory may vary
  • Test with various volume mount configurations

Technical Context

  • Component: Docker container terminal execution
  • Type: Bug fix requiring Docker CLI knowledge
  • Involves: Docker exec command construction, container filesystem understanding
  • Files affected: Docker execution utility functions
  • Requires: Testing with volume mounts and various container configurations

Download https://cap.so/ to record your screen (use Studio mode). Export as an mp4, and drag and drop into an issue comment below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions