Ability to just access a brand new VM's console directly

New to linux/docker and was wondering if theres any sort of “blank” app that would let me use the linux terminal (ex. fly ssh console) without having an actual app. I have some bash scripts (because i am familiar with bash) and i do not know anything about writing a dockerfile to run it. Ive tried this:

FROM ubuntu:latest
WORKDIR /app
COPY main.sh /app
RUN chmod +x /app/main.sh
CMD ["/app/main.sh"]

Obviously something is wrong here.
It gets through all the regular deployment stuff when doing fly deploy, and then says Error abort once monitoring deployment.
Here is the logs of the monitor page on fly.io:

(runner) [info] Starting virtual machine
[info] Starting init (commit: 8af0ddf)...
[info] Preparing to run: `/app/main.sh` as root
[info] Error: failed to spawn command: /app/main.sh: No such file or directory (os error 2)
[info] does `/app/main.sh` exist and is it executable?

Any help would be greatly appreciated.
Thanks,
Gavin

Before you try it the hard way, perhaps try it the easy way:

https://fly.io/terminal

Otherwise, try this Dockerfile:

FROM ubuntu:latest
CMD ["sleep", "infinity"]

But before you deploy, remove all lines from your fly.toml except the app and primary_region lines. After you deploy, run fly ssh console.

5 Likes

Thank you! I’ve tried the terminal but wanted to be able to keep a persistent filesystem + scaling the app up.

The file system you get with this will be wiped should the machine ever restart. You will need a volume to store data that survives a restart.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.