% 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?
Reason
The rm command is not a shorthand flag option, you need to provide two dashes before rm
Incorrect:$ docker run -rm ubuntu
Correct
$ docker run --rm ubuntu
Fix
As discussed above simply make sure that the rm is prefixed with two dashes and not one.

More Posts related to Docker,
- How to docker remove a container when it exits
- Install Python on Alpine Linux - Docker
- How to Rename Docker Image with none TAG and REPOSITORY?
- Remove all stopped containers in Docker using prune command
- [Fix] Docker Error response from daemon: manifest for :latest not found: manifest unknown
- [fix] Error response from daemon: conflict unable to remove repository reference ubuntu container is using its referenced image
- [Docker] Install Python3 on Alpine Linux
- Unable to find image docker latest locally
- How to Stop/Cancel/kill docker image pull
- How to know the Docker Engine Version
- [fix] Docker: OCI runtime exec failed unable to start container process
- [Solution] Alpine Docker apt-get: not found
- Install and Run Cassandra on Docker Desktop
- Install node on Alpine Linux Docker
- How to Copy files from Docker Container to Host System
- Install the minimal Linux on Docker (only 5 mb Alpine Linux)
- How to stop and start a docker container
- Docker - Error response from daemon: You cannot remove a running container
- Open Docker Desktop from macOS Terminal
- How to check installed docker version command
- How to know the Docker Sandbox ID of a Container Network?
- [fix] docker: Error response from daemon: dial unix docker.raw.sock: connect: no such file or directory.
- [Docker] Install Git on Alpine Linux
- Docker MySQL Compose File with Volume Example
- [fix] Docker: Alpine Linux - /bin/sh: bash: not found
More Posts:
- SharePoint 2016 error - Could not find file ManageUserProfileServiceApplicationTenantSimplified.xml - SharePoint
- Error code - 7: There's a more permanent way to sign in to Microsoft Teams - Teams
- Sublime Text 3 Convert Case to Upper, Lower, Title or Swap - Sublime-Text
- Convert Multidimensional Array toString In Java - Java
- PHP header location function not called - PHP
- Show battery percentage on MacBook Menu Bar [Ventura 13] - MacOS
- Test internet speed using macOS Terminal command - MacOS
- iPhone Message: A new iOS update is now available. Please update from the iOS 14 beta. - Apple