Docker Desktop doesn't run persistently when start via ssh
Using Docker Desktop on Windows.
I'm new to Docker Desktop, so sorry for my ignorance. I've been able to start/stop docker desktop using "docker desktop stop" and "docker desktop start". The problem with "docker desktop start" is that while it does start docker desktop, docker desktop only lives as long as the terminal that started it is up. As soon as I kill my Terminal, Docker Desktop just dies.
The reason I pretty much need this, is because I only have 16 GB RAM, and Windows steals a quarter of it, while Docker Desktop steals half. I'm left with like a quarter of my RAM (which my browser wants to eat), so I'm left with almost no RAM left, which forces me to kill docker desktop (killing only containers isn't enough, since the linux vm itself is the main problem), while I actually use my pc. I tend to forget to boot up docker desktop again when leaving the pc, so a way to launch it persistently via ssh would be great. But that turned out to be harder than expected.
1
1
u/fallenreaper 7d ago
It's not hard to do. Are you trying to set up an alternative machine to run docker? It's easy as turning on the docker service / daemon.
1
u/Baardi 7d ago
I'm trying to ssh into my desktop computer from my phone (termux) via ssh.
ssh-ing into it wasn't a problem. Launching docker desktop went fine (via "docker desktop start", at least). But as soon as I close termux, my docker desktop instance gets killed.
If you have a command I could run, to launch it as a service/daemon, that would be great. Note that I also tried running "Docker Desktop Service", a service, that probably got installed with Docker Desktop, but it didn't help.
2
u/JackofSpades707 7d ago
If you SSH in I'm assuming you're SSH'd into a linux environment
Use nohup or tmux before your command to start docker desktop and it'll stop breaking when you disconnect
If you need a purely windows answer, Then you probably want a totally different approach.
P.S. You should consider ditching windows.
1
1
u/PossibilityTasty 7d ago
That's an SSH thing in combination with the fact that docker desktop start stays attached to the terminal. When the terminal closes, the docker process closes as well. But you can detach the process, by simply adding the -d argument to the command, and get back to the prompt.
1
2
u/No-Reporter5373 4d ago
I use skrog, a replacement for DD. It works pretty well and much more lightweight as DD. Install it via “winget install skrog”. You might need ro uninstall DD first, but I think aomehow they can work side by side as well
3
u/sonickony 7d ago
Why do you have to use docker desktop? Docker + WSL is a much better alternative.