Prerequisite:
Make sure you complete this lab: https:/www.devopstreams.com/2022/02/how-to-pull-images-from-docker.html before attempting this
You can connect to a running container just like you can connect to a server and then run commands in that container. To do that you have to make use of the docker exec command
Step 1: Create a Container from a Jenkins image. see https:/www.devopstreams.com/2022/02/how-to-pull-images-from-docker.html
Step 2: Lunch another terminal on your docker host( Separate from the one you used on step1)
Step 3. Connect to your running container
docker exec -it container_id sh--------->replace ur container id in red
docker exec -it 65357f31b2bc sh
This will connect you to the shell of the container.
No comments:
Post a Comment