New to docker, I am trying to run the "selenoid" container from docker hub during a TFS / azure devops build process. The 1st execution works, but during the next ones I get a conflict error (container already exists with that name). After reading few posts here, I understood that I have 2 solutions :
1/ keep the run command but execute "rm" command on that container before running it again.
2/ determine if container already exists and use "start" for the next build runs.
For the 1st solution, I guess it is not really performant to delete/recreate that container each time ? I thought about the 2nd one, but it is also a little bit more complicated to make a script that check if container exists, and then use start or run.
So isn't there a simple "run" option/flag that would change the "run" command behavior so that it create the container only if needed and then start it ?
Also, I could have made a script that makes the job, but I prefer to ask it here, because maybe I did not understood the correct way to use containers (if I am the only one to ask for that option, I may have missed something...)