I’m trying to run an emulated raspberry pi inside a vm on fly but I’m running into issues exposing the shell for the machine when deployed on fly, even though it works when I run it locally.
The image is running when I deploy it via fly machines, and I can see the expected logs in the monitoring tab of my dashboard. Yay, emulated raspberry-pi in the cloud.
I want to connect to the process that’s outputting the logs in the monitoring tab, the emulated terminal for the raspberry pi.
I think I might be missing something obvious, since it works pretty easily locally with just docker run, and I can see the expected logs in the monitoring dashboard.
Any ideas on how I can access that specific process when I ssh into the machine?
fly ssh console runs sh like you saw - it’s essentially, SSH-ing in and starting a new process, not attaching to a currently running process.
When launching on Fly, Fly.io is running ENTRYPOINT + CMD as defined in the container image (altho it converted the docker image to a VM, so it’s not actually running Docker). Fly usually runs the entrypoint+cmd as some PID > 1 (since Fly.io has it’s own init that’s running as pid 0 or 1 or something like that).
In any case, attaching to a process that’s running in a way that’s interactive doesn’t sound like a thing that’s possible (even outside of Fly). It’s more akin to running docker exec -it... locally against a running Docker container - it doesn’t attach to the primary process being run, but instead runs a new process in the same container.
So… perhaps change your ENTRYPOINT/CMD in your Dockerfile to the equivalent of sleep 365d, and then when you ssh in, run the command that used to be listed as the ENTRYPOING/CMD?