Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile: Use CLI generated completions in the dev shell #47649

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Mar 28, 2024

- What I did
Enabled Docker shell completions in the dev container shell.
This doesn't affect anything outside the development shell.

- How I did it
Use Cobra-generated completion scripts for the CLI inside the dev container shell.

- How to verify it

$ make shell
$ docker im<TAB>
image   images  import
$ docker pull --<TAB>
--all-tags               --disable-content-trust  --platform               --quiet

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Use Cobra-generated completion scripts for the CLI inside the dev
container shell.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland added status/2-code-review kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. area/testing labels Mar 28, 2024
@vvoland vvoland added this to the 27.0.0 milestone Mar 28, 2024
@vvoland vvoland self-assigned this Mar 28, 2024
RUN echo "source /usr/share/bash-completion/bash_completion" >> /etc/bash.bashrc
RUN ln -s /usr/local/completion/bash/docker /etc/bash_completion.d/docker
# Include Docker's completion if mounted with DOCKER_BASH_COMPLETION_PATH
Copy link
Member

Choose a reason for hiding this comment

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

Somewhat wondering if we still need the DOCKER_BASH_COMPLETION_PATH code 🤔 It was added in #33801 to help with the manually written bash-completion scripts, so ... perhaps? That said, we also have the moby-bin image, so maybe we could create something in the docker/cli repository to help spin up a docker-in-docker environment with the latest daemon and the current CLI (and completion script)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah looks like we could remove it from moby and do that in the CLI which would be more appropriate place for shell completion development.

@vvoland vvoland modified the milestones: 26.1.0, 27.0.0 Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants