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:

- 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

- Now lets execute
docker login # Enter docker hub credentials

-
Now the docker image is available for others

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

-
Lets do the same with AWS Elastic Container Registry

-
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

- execute
- Remove all running docker containers

- Remove all docker containers in running and stopped state

- Logs: The logs command will show all the stdout stream of your contianer

- To list the running processes in your container use top command

- 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

- Limiting Resources to container
- Lets execute
docker container run --help - Refer Here for commandline documentation

- Lets execute
- Lets inspect containers

- Docker container states

