forked from Dokploy/dokploy
-
Notifications
You must be signed in to change notification settings - Fork 161
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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
- Create Docker Compose application with volume mounts
- Deploy the application
- Navigate to container terminal
- Attempt to execute command or open shell
- Receive OCI runtime exec failed error
- Force recreate container
- 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
Labels
bugSomething isn't workingSomething isn't working