-
Notifications
You must be signed in to change notification settings - Fork 213
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
/init hangs when starting a container using non-native image (QEMU) #537
Comments
I was just digging through issues, and I found something that helps! /init REALLY does not like it when you run the container with a tty ( See The most frustrating thing was that there was no output at all when this happens. Is there a way to /init can detect this situation and give us a headsup? |
It's unfortunately impossible to make s6-overlay work with all cases by default when your container needs a terminal. But there should always be a setting that works for you. When you run the container with |
That did not work. It still hangs. It doesn't matter if the command is I tried a new test where I tried to launch Basically, if I supply Actually, specifying no command at all causes |
Oh. Yeah. I'm afraid it's yet another of these "don't do that" cases. Terminals are a quirky parts of Unix, with lots of moving parts; it is difficult to support them in s6-overlay for a variety of reasons. I am, unfortunately, not at all surprised that it doesn't work when you add qemu into the mix - qemu also has to do its own terminal shenanigans, and it is to be expected that they don't mesh well with containers underneath. I'm sorry I don't have a better answer for you, but try fiddling with qemu's setting? This is not something I can help with at the s6-overlay level. |
I was able to workaround this issue by just making sure to not Here is script I use to run and enter one a s6 overlay based container using multi-platform via QEMU. #!/bin/bash
# Note - S6 overlay does NOT like it when you give it a tty (-it) under QEMU. Run it in background (so we get log output) then
# exec a bash process to enter the container.
# Install a trap to monitor when bash script exits, and stop the running container with its done
trap "trap - SIGTERM && docker stop insert_your_container_name" SIGINT SIGTERM EXIT
docker run --rm --name insert_your_container_name--platform linux/arm/v7 insert_your_container_name:insert_tag &
sleep 5
docker exec -it insert_your_container_name bash Do you think you could add a section to your FAQ specifically about avoiding |
Yeah, I'll add a note about that. |
Note added in the README.md, under the Notes section, and the new release is out. Can I close this issue? |
I'm not exactly sure, but launching these images using QEMU I think has the same problem as described in the linked.
I think its possible to do with S6 wanting to be PID 1. I verified that the "unshare" workaround works for me, but its unideal as it needs a privileged container, and it doesn't respond to SIGTERM (but at least it starts).
I plan on using this just for testing the images overriding the --entrypoint. The images I'm creating will continue to use /init. But I would like to understand what is going wrong here.
Workaround from: pi-hole/docker-pi-hole#1176
Dockerfile
Test script
The text was updated successfully, but these errors were encountered: