DevOps Classroom Series – 07/Nov/2020

Storing and distributing docker Images

  • As of now we can build docker images for the application by creating a Dockerfile
    • right base image
    • steps to install / configure your application
    • ports used by application
    • commands to start/run your app
  • Workflow: Preview
  • Now Lets realize this workflow for gameoflife
  • Whenever a new version of commited a new Docker image can be generated. Dockerfile is created generally in the source-code archive. Refer Here
  • Whenever the code is commited we can generate a Dockerimage with a new tag. This tag is build locally on some machine, but it should be made available to others (In Enteprise means other members, In public means anyone)
  • Lets get Started with using a Default Registry called as DockerHub
  • Lets build the docker image
docker image build -t gameoflife:07112020 .
  • Now create a tag that matches repository name
docker image tag gameoflife:07112020 qualitythought/gameoflife:07112020

Preview

  • Now lets execute
docker login # Enter docker hub credentials

Preview Preview

  • Now the docker image is available for others Preview

  • Now lets use azure container registry. Refer Here for creating a docker registry in azure cloud

  • screenshots Preview Preview Preview

  • Lets do the same with AWS Elastic Container Registry Preview Preview Preview Preview Preview

  • Now install aws cli. Refer Here

  • Docker Trusted Registry:

    • This registry is part of Docker Enterprise
    • This registry integrates with LDAP
  • Artifactory (Jfrog) Docker Registry

  • Docker Registry: This docker image can be used as registry Refer Here

Managing Docker Containers

  • We have already discussed running containers in
    • foreground
    • detached
    • interactive
  • when we create a docker container every container will have a name and id.
  • docker container is started in a detached mode. Is there any way to login into it
    • execute docker attach <cont-id or name>
    • execute docker container exec -it <cont> /bin/bash Preview Preview
  • Remove all running docker containers Preview
  • Remove all docker containers in running and stopped state Preview Preview
  • Logs: The logs command will show all the stdout stream of your contianer Preview Preview
  • To list the running processes in your container use top command Preview
  • The stats provides real-time information on the specified container or if you don’t pass name or id it shows for all the running containers docker container stats Preview Preview
  • Limiting Resources to container
    • Lets execute docker container run --help
    • Refer Here for commandline documentation Preview Preview Preview Preview Preview Preview
  • Lets inspect containers Preview Preview
  • Docker container states Preview Preview Preview Preview Preview Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin