What are the options for the “docker run” command?

The Docker run command has many options, here are some commonly used options:

  1. -d: Run the container as a background daemon in the future.
  2. Mapping the container’s port to the host’s port.
  3. -v: Mount the directory or file of the host to the directory or file of the container.
  4. –title: Assign a name to the container.
  5. –restart: Specifies the restart policy for the container after it exits.
  6. – e: establish environment variables
  7. –link: Connect other containers to a running container.
  8. –network: Specifies the network mode for the container.
  9. – volume: set up persistent storage for the container.
  10. –rm: Automatically remove container when it exits.

These are just a few common parameters, there are many other parameters available with the docker run command. You can use the docker run –help command to see all available parameters.

bannerAds