1.1 KiB
Containers
Containers can be thought of as lightweight, stand-alone, and executable software packages that include everything needed to run a piece of software, including the code, runtime, libraries, environment variables, and config files. Containers isolate software from its surroundings, ensuring that it works uniformly across different environments.
Working with Containers using Docker CLI
Docker CLI offers several commands to help you create, manage, and interact with containers. Some common commands include:
-
docker run
: Used to create and start a new container. -
docker container ls
: Lists running containers. -
docker container stop
: Stops a running container. -
docker container rm
: Removes a stopped container. -
docker exec
: Executes a command inside a running container. -
docker logs
: Fetches the logs of a container, useful for debugging issues.
Visit the following resources to learn more: