Linux Create and start a Docker container:
Recommended learning: Linux video tutorial
Use the following command to start a new Docker container. This will start a new container and give you access to the container using the /bin/bash shell.
# docker run [OPTIONS] <IMAGE NAME> [COMMAND] [ARG...]
For example, the following command will create a new docker container using an image named "ubuntu". To list all available images, use the docker images command
# docker run -i -t ubuntu /bin/bash
To exit a Docker container, press ctrl p q. This will cause the container to run in the background and provide a console to the host system. If you use the exit command, it will stop the current container.
For more related tutorials, please pay attention to the docker tutorial column on the PHP Chinese website.
The above is the detailed content of How to create a new docker container in linux. For more information, please follow other related articles on the PHP Chinese website!