I have a container named test. I want to be able to start the container on Ubuntu boot which I think I can do with the always command.
Then I want to run one command when the container boots. For instance, I want to run ls so it shows me the list of files and directories within the container.
How do I run the ls command when the docker container boots? So, there are two things:
Docker container boots automatically on Ubuntu booting
As soon as the container boots, from within the container, one command will be executed.
I can manually do it using:
sudo docker run --rm -it test
Then when the test container begins, I can type ls in the terminal.
I want to do it automatically on boot, the actual command will be different, I am using ls for simplicity.