enter docker container shell 1

enter docker container shell

docker exec -it  bash
docker exec -it  sh ##for alpine

Here is what the above code is Doing:
1. We’re using the docker command to run a new container.
2. We’re using the -it flags to specify that we want to run an interactive session.
3. We’re using the –rm flag to specify that we want to remove the container when we exit.
4. We’re using the -v flag to mount the current directory on the host to the /app directory in the container.
5. We’re using the -w flag to set the working directory to /app.
6. We’re using the python:3.7-alpine image as the base image for our container.
7. We’re using the python command to run the Python REPL.

Similar Posts