docker run -d -name container-name alpine watch "date > /var/log/date.log".If you don’t already have a container, start a test container with the following docker run command: To use the docker exec command, you will need a running Docker container. If you need to run docker as the root user, please remember to prepend sudo to the commands in this tutorial.įor more information on using Docker without sudo access, please see the Executing the Docker Command Without Sudo section of our How To Install Docker tutorial. This tutorial assumes you already have Docker installed, and your user has permission to run docker. In this tutorial we will learn about the docker exec command and how to use it to run commands and get an interactive shell in a running Docker container. To this end, Docker provides the docker exec command to run programs in containers that are already running. When developing or deploying containers you’ll often need to look inside a running container to inspect its current state or debug a problem. Docker is a containerization tool that helps developers create and manage portable, consistent Linux containers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |