Friday, February 4, 2022

Docker cookbook

  docker --version

  docker pull <image_name>

  docker images

 docker run -it -d <image_name>

 docker ps

 docker ps -a

 docker exec -it docker exec -it <image_name> vin bash

 docker exec -it <image_name> /bin/bash

 docker  cp <image_name>:path/to/file path/to/ur/my_file

 docker logs <image_name> > your_location/some_file.log

 docker build -t <image_name> .

 docker run --name=<image_name> -it -p 8080:8080 -h SOME_info -e SOME_PARAMETER=ABC  /bin/sh

docker login

docker login -u <user> -p <pwd> artifactory_server_host

docker logs

docker logs -f [container_name]


-v : creating storage space separate from container

 docker run  -v /var/lib/mysql 

printenv

 

Docker Compose

  • Can manage multiple containers running on a virtual network.
  • These containers are able to communicate with each other because they share the same network, which is created and managed by Docker Compose. 
  • Containers within the same network can resolve each other's names, allowing them to interact seamlessly.



No comments:

Post a Comment