Dockerfile: Use CLI generated completions in the dev shell#47649
Dockerfile: Use CLI generated completions in the dev shell#47649thaJeztah merged 1 commit intomoby:masterfrom
Conversation
| # Activate bash completion | ||
| 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 |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I see you rebased this one; still think we should probably just remove this, and perhaps this step could happen after we copy the CLI into the dev-image? At least, I think that way we can skip the complexity around mounting etc?
RUN /usr/local/cli/docker completion bash >/etc/bash_completion.d/dockerMaybe the other (completion-related) steps should be moved there to the end as well, or would that all impact caching?
There was a problem hiding this comment.
Removed, and moved the completion generation to the stage which builds the cli
7cca5b7 to
d998668
Compare
Use Cobra-generated completion scripts for the CLI inside the dev container shell. Remove `DOCKER_BASH_COMPLETION_PATH`. Signed-off-by: Paweł Gronowski <[email protected]>
d998668 to
54a969d
Compare
|
Heh; yeah, we need to tweak this one; I saw it fail elsewhere as well; what I think happens is that tests run in parallel, and it may therefore count unrelated things; |
- 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
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)