Skip to content

Add bash completion to the development container#33801

Merged
thaJeztah merged 1 commit intomoby:masterfrom
albers:completion-dev-environment
Jun 24, 2017
Merged

Add bash completion to the development container#33801
thaJeztah merged 1 commit intomoby:masterfrom
albers:completion-dev-environment

Conversation

@albers
Copy link
Copy Markdown
Member

@albers albers commented Jun 23, 2017

For developing bash completion, I need an environment with

  • Docker daemon
  • Docker cli
  • the bash completion script

Bash completion was removed from this repository in #33665 and is now located in docker/cli.
#32694 added a way to mount a development version of the docker binary into the development container.
This PR adds a way to also include the bash completion script.

It does so by adding an environment variable DOCKER_BASH_COMPLETION_PATH to the Makefile.
The variable works like DOCKER_CLI_PATH: The directory hosting the specified file is mounted into the container. A symbolic link in /etc/bash_completion.d/ activates the completion script on container startup.

The command to start a container for developing bash completion would be

DOCKER_CLI_PATH=~/go/src/github.com/docker/cli/build/docker DOCKER_BASH_COMPLETION_PATH=~/go/src/github.com/docker/cli/contrib/completion/bash/docker make shell

To verify: start the container with the given command and try bash completion of any Docker command.

Please merge quickly. Because I had no working dev environment for several weeks, some missing features queued up.

Adds an environment variable `DOCKER_BASH_COMPLETION_PATH` that allows to
include a bash completion script into the development container.

This is needid for development of bash completion.

Signed-off-by: Harald Albers <[email protected]>
@albers
Copy link
Copy Markdown
Member Author

albers commented Jun 23, 2017

@tiborvass, @thaJeztah, @mlaventure Would you like to take a look at this?

Copy link
Copy Markdown
Contributor

@mlaventure mlaventure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I had to do source /etc/bash_completion first though, but that was already the case before.

@albers
Copy link
Copy Markdown
Member Author

albers commented Jun 23, 2017 via email

@thaJeztah
Copy link
Copy Markdown
Member

I had to do source /etc/bash_completion first though, but that was already the case before.

Should we do that as part of make shell?

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@albers
Copy link
Copy Markdown
Member Author

albers commented Jun 24, 2017

Should we do that as part of make shell?

@thaJeztah Created #33816

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants