Epic: "compose run" should support every "docker run" option
Problem
`fig run` should support every option of `docker run`, just referring to a service instead of an image. [code block] Todo (in rough priority order) - [x] `-u` https://github.com/docker/compose/pull/971 - [x] `--entrypoint` https://github.com/docker/compose/pull/511 - [x] `-w` https://github.com/docker/compose/pull/332 - [x] `-p` https://github.com/docker/compose/issues/1709 - [x] `-v` - [x] `--cpuset` - [x] `--memory` - [x] `--env-file` - [x] `--net` - [x] `--memory-swappiness` #2383 - [ ] `--volumes-from` #1769
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Enhance 'fig run' to Support All 'docker run' Options
The current implementation of 'fig run' in Docker Compose does not support all options available in 'docker run', limiting the flexibility and functionality for users who need to run services with specific configurations. This is primarily due to the incomplete mapping of Docker run options to the Compose command structure.
Awaiting Verification
Be the first to verify this fix
- 1
Implement Support for '--volumes-from'
Add parsing and handling for the '--volumes-from' option in the Compose run command. This will allow users to specify volumes from another container when running a service.
typescriptif (options.includes('--volumes-from')) { /* handle volumes-from logic */ } - 2
Update Documentation
Revise the official Docker Compose documentation to include the new options supported by 'fig run', specifically highlighting the newly added '--volumes-from' option.
markdownUpdate the README.md and command reference documentation. - 3
Run Integration Tests
Create and execute integration tests to ensure that the new '--volumes-from' option works correctly with various service configurations. This will help verify that the implementation does not introduce any regressions.
javascriptdescribe('fig run with volumes-from', () => { it('should run the service with specified volumes', () => { /* test logic */ }); }); - 4
Gather User Feedback
After deploying the changes, collect feedback from users regarding the new functionality to identify any issues or additional needs for further enhancements.
markdownCreate a feedback form or survey linked in the documentation.
Validation
To confirm the fix worked, run 'fig run <service> --volumes-from <other_container>' and verify that the volumes from the specified container are correctly mounted in the service container. Additionally, check the updated documentation for accuracy.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep