FG
☁️ Cloud & DevOpsDocker

Epic: "compose run" should support every "docker run" option

Freshabout 21 hours ago
Mar 14, 20260 views
Confidence Score83%
83%

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

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Enhance 'fig run' to Support All 'docker run' Options

Medium Risk

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. 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.

    typescript
    if (options.includes('--volumes-from')) { /* handle volumes-from logic */ }
  2. 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.

    markdown
    Update the README.md and command reference documentation.
  3. 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.

    javascript
    describe('fig run with volumes-from', () => { it('should run the service with specified volumes', () => { /* test logic */ }); });
  4. 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.

    markdown
    Create 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

AC

Alex Chen

2450 rep

Tags

dockerdocker-composecontainersstale