fix 1476 let ssh use stdin to type password when docker run with -it
Signed-off-by: Lifubang [email protected]
- What I did As the issue #1476, when use ssh with password, docker run -it will fail.
- How I did it Because after attachContainer, ssh can't use stdin to type password. So, in func attachContainer, use a call back func beforeHijack to run ContainerStart before hijackedIOStreamer.
- How to verify it After fix:
docker -H ssh://localhost run --name=testssh -it --entrypoint=/bin/bash docker.acmcoder.com/public/ubuntu:ssh
root@localhost's password:
root@localhost's password:
root@localhost's password:
root@25eaf3b846dc:/# ls -lh
total 64K
drwxr-xr-x 2 root root 4.0K Oct 1 2015 bin
drwxr-xr-x 2 root root 4.0K Apr 10 2014 boot
- Description for the changelog modify attachContainer add a param "beforeHijack func() error"
- A picture of a cute animal (not mandatory but encouraged)

Codecov Report
Merging #1477 into master will decrease coverage by
0.95%. The diff coverage is25%.
@@ Coverage Diff @@
## master #1477 +/- ##
==========================================
- Coverage 55.14% 54.19% -0.96%
==========================================
Files 289 289
Lines 19371 19386 +15
==========================================
- Hits 10683 10506 -177
- Misses 7997 8204 +207
+ Partials 691 676 -15
ping @AkihiroSuda PTAL
Thx, can we have e2e?
Thx, can we have e2e? @AkihiroSuda It's very hard to add e2e case, because:
- We need
expectto auto input user's password; - But
expecthave no stderr; - There is at least one "root@localhost's password:" in stdout, it's very hard to remove it.
So, I think it's very hard to add e2e case. You can see my commit: https://github.com/lifubang/cli/commit/b121f2484944605cefdefd068215349518437e49 I think we can add e2e cases in a new PR if we need.
Yes, E2E can be added separately, but I think password auth should not be considered to be supported officially for now then https://github.com/docker/cli/pull/1482
What's current status?
This patch can input password correctly. But I can't find a way to add a test case, I have no idea now. If someone have a time, please take a look #1487 . Thanks.
Will this be fixed soon? I cant use my development docker cli with my home server. I really need this!