Hello all,
I am new with docker and I would like to know if it is possible to use a container as VM.
I have this compose:
version: “3”
services:
debian:
image: debian:
container_name: TEST
restart: unless-stopped
And it restarts automatically every 1 or 2 seconds. I have done a research and all answers are the same “Docker is used to run a task and then stop the container” and if you want to keep it alive you must add something like “tty: true” in the compose (it works) and it will keep alive. Is not correct to use the containers as ‘virtual machines’ ?
But I can not understand it because I used some Docker services like Nginx or MySQL and those containers did not restart automatically like the Debian or Alpine, they are alive 24/7 and the docker-compose does not have this “tty: true”… Can someone let me know why?
Regards,