Tuesday, August 21, 2018

Docker management Part-2



Docker management

















1. To check any containers running inside the docker use docker ps command






2. To get the currently running and stopped containers






3. To run a container image






4. To get the logs of a container with container ID





5. To login inside the docker use below command






6. To push the images in custom path in your docker server use below command








7 . If we login to the docker hub using web we can see the image as below











8. To run the docker image on background ,





This command will generate a random ID where the first 12 characters are the docker ID

9. Use the docker ps command to verify the docker ID and status




 Now we can execute commands inside the docker 

10 . To see the contents of a docker image use the below command 











11. We can login to the container image using the below command 





12. stop the container





13 Start the container 





14 . To map the ports inside the docker use below commands






15. Inspecting  a docker container using docker inspect <docker id>












16 Docker let's you to store data such as configuration settings encryption keys and external resource address in environment variables . At run time environment variables are exposed to the application inside the container. We can set the environment variables inside a services containers with environment key .
           Below are the example of setting below parameters inside a maradb image 

  











  • First pull the image of mariadb 











  • We can check the status of the image using below command 






  • No let's run the command to start the database container by passing required variables mentioned above 




  • The container was created successfully and we need to verify whether example_user has the access to example database 






Thank you for reading and stay tuned for more topics 


No comments:

Post a Comment