Skip to content

Proposal: Config file for default command line options #7232

@bfirsh

Description

@bfirsh

Docker needs a way of specifying options to "docker run" in a file.

You shouldn't have to write all this:

docker run -i -t --volumes-from=shykes-dev -v /var/run/docker.sock:/var/run/docker.sock -u 0 --name project -h project shykes/devbox bash

Instead, this could be in a file called .docker/config:

[run]
interactive=true
tty=true
volumes-from=shykes-dev
volume=/var/run/docker.sock:/var/run/docker.sock
user=0
name=project
host=project
image=shykes/devbox
cmd=bash

Then you can just run docker run in the same directory as that file.

This is a bit like how .git/config works, where you can, for example, specify options under a [log] section that overrides options on git log.

You could also specify what file to use with the --config option, like so:

docker --config=/etc/docker/config run

If you want to disable the config and specify options manually, there could be a --no-config option.

Environment variables could be specified by using the env-file option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliClientkind/featureFunctionality or other elements that the project doesn't currently have. Features are new and shiny

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions