bocker icon indicating copy to clipboard operation
bocker copied to clipboard

bocker bash doesn't display a prompt

Open basdp opened this issue 9 years ago • 8 comments

It looks like bocker run bash works, but there is no way I can get a prompt. Even 'export PS1="$ "' doesn't work. It is not that big of a problem, but I'm afraid this will just be the tip of the iceberg.

basdp avatar Jul 30 '15 08:07 basdp

Probably the same issue. I created a container with a sshd running. When I login, I get the following message:

PTY allocation request failed on channel 0 stdin: is not a tty

basdp avatar Jul 30 '15 12:07 basdp

You can try passing -t I believe?

chino avatar Jul 30 '15 12:07 chino

ssh -t 10.0.0.15 results in a direct disconnect after the "PTY allocation request failed on channel 0" message.

basdp avatar Jul 30 '15 12:07 basdp

Okay, doing some more investigation: It seems that this line is the problem: 2>&1 | tee "$btrfs_path/$uuid/$uuid.log" If I remove that part, it seems to work correctly. Although, SSH is still experiencing the same issues.

$CGX:$uuid ip netns exec netns_"$uuid" "unshare" -fmuip --mount-proc "chroot" \
    "$btrfs_path/$uuid" /bin/sh -c "/bin/mount -t proc proc /proc && $cmd" \
    2>&1 | tee "$btrfs_path/$uuid/$uuid.log" || true

basdp avatar Jul 30 '15 13:07 basdp

I'm on a roll!

I fixed the SSH issue by running this command in the container:

mount -t devpts none /dev/pts

basdp avatar Jul 30 '15 13:07 basdp

@basdp Thanks for reporting this. It looks like tee is blocking stdout, probably because the steam is still open. Will try and address this today or tomorrow.

p8952 avatar Jul 31 '15 18:07 p8952

It's probably worth mounting pts by default.

I don't run SSH in containers, can you suggest me a Docker image to test with with?

p8952 avatar Aug 03 '15 18:08 p8952

If still relevant, this one: https://hub.docker.com/r/evarga/jenkins-slave/

jovandeginste avatar Aug 21 '15 14:08 jovandeginste