So I've pulled the amd64/ubuntu:latest image, which is an Ubuntu 20 image for docker and customized it a bit. Not much - zsh, vim, locales and openssh-server compiled from source (because the package wants me to download 100Mb of some stuff, whereas the compiled version is only 1.5 Mb)
In this case, I don't think those are the reason for the following problem: I did not intend to use Dockerfiles with this one, and I created and ran containers with the following command:
$ docker run -dit --network=my_docker_network --name=MyContainer \ local/ubuntu:latest
This works fine on my Ubuntu 20.04 - notice how there isn't a command after the image name, which, as per documentation, is supposed to be there, but it looks like it isn't needed here. The
sshd is later started manually by the
docker exec command and works fine.
Now, to test the compatibility, I've installed Ubuntu 21 on a VirtualBox, then installed docker there and imported my custom image
local/ubuntu:latest. Docker versions and the way they are run seem to be exactly the same - v20.10.12. When I run the same
docker run... command on Ubuntu 21, it refuses to start start the image, saying another argument - the COMMAND - is require. Yet when I provide ANY command as the last argument, for example:
$ docker run -dit --network=my_docker_network --name=MyContainer \ local/ubuntu:latest /usr/bin/sh -c 'echo OK'
$ docker run -dit --network=my_docker_network --name=MyContainer \ local/ubuntu:latest /usr/bin/sshd
it says they're not in $PATH or file doesn't exist.
If I try and create a container first, it is indeed created with:
$ docker create -it --network=my_docker_network --name=MyContainer \ local/ubuntu:latest
But the same problem occurs once I try actually starting it. What is this? What am I missing?