p8952 / bocker

Docker implemented in around 100 lines of bash
https://www.p8952.info/
GNU General Public License v3.0
11.26k stars 715 forks source link

bocker bash doesn't display a prompt #16

Open basdp opened 9 years ago

basdp commented 9 years ago

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 commented 9 years ago

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

chino commented 9 years ago

You can try passing -t I believe?

basdp commented 9 years ago

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

basdp commented 9 years ago

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 commented 9 years ago

I'm on a roll!

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

mount -t devpts none /dev/pts
p8952 commented 9 years ago

@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 commented 9 years ago

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?

jovandeginste commented 9 years ago

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