[Fix] Docker Run unknown shorthand flag: 'r' in -rm

 % docker run -rm -it --name mydoc -p 80:8080 alpine 
unknown shorthand flag: 'r' in -rm
See 'docker run --help'.

Are you are getting the unknown shorthand flag error when you are trying to run a Docker Image to create a container using the run command?


The rm command is not a shorthand flag option, you need to provide two dashes before rm

$ docker run -rm ubuntu
$ docker run --rm ubuntu


As discussed above simply make sure that the rm is prefixed with two dashes and not one.

Docker unknown shorthand flag error fix
Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap