docker log into container code example
Example 1: docker access container
docker exec -it <mycontainer> bash
docker exec -it <mycontainer> sh
Example 2: docekr enter container
docker exec -it [container-id] bash
Example 3: how to bash into docker container
docker exec -it nginx /bin/bash
Example 4: docker login to ecr
PASSWORD=$(aws ecr get-login-password 2>&1)
docker login -u AWS -p $PASSWORD https://<account number>.dkr.ecr.<region>.amazonaws.com
Example 5: how to docker login
$ docker login --username=maryatdocker --email=[email protected]
Password:
WARNING: login credentials saved in C:\Users\sven\.docker\config.json
Login Succeeded