Reboot Ubuntu 18.04 from Docker Image


I’m using the standard base image for Ubuntu 18.04 from DockerHub
It’s really stripped down, almost any command I want to call has had to be installed first.
So far, sudo being the most surprising that I might have assumed would have been in the core.
I’m not able to call reboot, which I’m hoping will pick up systemd next time.
My question is what am I suppose to install or call to be able to reboot?


what about shutdown -r now ?


I suppose it’s possible one of my experiments has damaged the container…
I may start over and just try to reboot a fresh container


well, granted i’m not familiar with docker, but my quick google searches turn up a few options, depending on what you want to do: (My information is coming from this link)

Stop the Container, Inside The Container: Ctrl-D should terminate the session and halt the container.
Escape the Container, without Stopping: Ctrl-P and then Ctrl-Q, returning your terminal while keeping the container alive.
(The following comes from here.)
Stop the Container from Docker: docker stop ContainerName
Re-start the Container from Docker: docker start ContainerName
Delete a stopped container from Docker: docker rm ContainerName


I’ll try it… but it feels like a hack. The answer I’m looking ‘feels’ like it should be at the linux layer, these are all attempts to get docker to emulate the behavior I’m wanting out of Ubuntu.


Kind of the the problem when I started this project, all the tutorials were for running Docker on Linux, not Linux in Docker.



I’ve never rebooted a docker container from within docker itself, I always stop/start it with the docker command, as @m_hutley posted above.

Docker is not a VM, you shouln’t treat it as such :slight_smile:


I’ve got the free tier at AWS for a year, but all the tutorials say don’t do this in production… I thought this would be a good way to practice security. my php experience has always been the AMP on a Windows or MAC. I’ve never had a Linux to practice on, but the more I study the technical details the less creative I’m feeling.
I’ve got the Oracle Virtual Box set up, I just have to toggle the Hyper-visor at Boot, if I’m not going to use Docker… you think I’d be better off exploring this stuff in there? I tried the Linux-Sub system today and it freezes on the installation…


What’s your endgoal? Do you want to learn Linux, or are you creating some production setup?


I have 3 urls… I want to host on one server. Recreating my first php site from Bonefire as a portal for lawn care and a basic demo. Then probably a Drupal for portfolio of Free Code Camp and Twitch tutorials. Then if the server can still handle it a game demo, probably in Node JS. So my goal is education and portfolio. Not sure what made the difference, perhaps patience… but the Subsystem on Windows 10 finally finished the installation. Ironically reboot gave me the same not booted with systemd message I started this thread at…
Using the free tier I get access to the AMI image which is Ubuntu 18.04 so I thought docker would be a good way to practice that with out exposing my home system.
Cloud Nine defaults to 14.04… I might need to see if I can upgrade C9 to 18.04, that might be the closest to the final environment with least security openings to a newbs practicing


Certainly don’t run 14.04, that’s end of life. Upgrading to 18.04 sounds like a good plan :+1:


doesn’t sound like they are keeping up with the times
It’s mainly commands like sudo hostnamectl, systemd or netplan ? I’ve had trouble figuring out…
and none of them seemed designed for me to reboot. I’m about to try tmux in docker next