You can use the `docker run` command to run a Docker image. The syntax for running a Docker image is:
`docker run [OPTIONS] IMAGE [COMMAND] [ARG…]`
Here is a simple example:
`docker run ubuntu`
This command will run the latest version of the `ubuntu` image.
If you also want to run a command inside this container, you can append the command at the end:
`docker run ubuntu echo “Hello, World!”`
There are a lot of options you can use with `docker run`. Here are a few commonly used ones:
- `-d`: This option stands for “detached mode”. It will start the container in the background.
- `-p`: This option stands for “publish”. It will publish a container’s port to the host.
- `—name`: This option sets a name for the container.
Here is an example that runs an `nginx` server in detached mode and forwards the port:
`docker run -d -p 8080:80 —name my_nginx nginx`