AWS Cloud Developer: Containers using Docker Flashcards
Common Deployment Headaches
Organizations often have different development environments. These often include development and production.
Deploying and testing the same code across different environments can be cumbersome
In practice, it’s difficult to keep a development and production environment perfectly synchronized with regards to their versions, operating systems, dependencies, etc.
It is common for code to work in a development environment and not behave as expected in production
A property where a resource is expected to be terminated
Ephemeral
Resources that are required in order to properly run an application
Dependencies
The act of making new software changes available
Deployment
Why should containers be stateless?
Containers are ephemiral and will eventually be destroyed.
Containers
A Container is a unit of eployment. It’s a self-contained application with all the dependencies needed to run
Docker command: Create Docker image
docker build -t
Docker command: Show Docker images:
docker images
Docker command: Run Docker image
docker run
Docker command: Show running Docker containers
docker ps
Docker command: Terminate a Docker container
docker kill
What is a Dockerfile?
A Dockerfile defines the steps to create a Docker Image
Application code uses instructions in a Dockerfile to create a Docker Image which is deployed to Docker Container(s).
Docker
Docker is a platform that helps us manage the process of creating and managing our containers.
Docker Image
When we have an application that we want to deploy, we can package it into a Docker Image. The image contains all of your code and dependencies.
Docker Container
A Docker Container is an ephemeral running instance of a Docker Image.
Base image
A set of common dependencies built into a Docker image that acts as a starting point to build an application’s Docker images to reduce build times
Container
Grouped software dependencies and packages that make it easier and more reliable to deploy software
Container Registry
A centralized place to store container images
Docker-compose
A tool used to run multiple Docker containers at once; often used to specify dependent relationships between containers
image
A snapshot of dependencies and code used by Docker containers to run an application
troubleshooting/debuggin docker
docker inspect
docker logs
docker ps
Attach to container:
docker exec -it sh
once inside run the following to see processes :
ps aux
System Process
A computer program run by the operating system
What are some reasons why a container may work in a local environment but not run successfully in a deployed environment?
Security restrictions
Not enough system resources
Credentials are different
Container Registry
A container registry serves as a centralized place for us to store and version our images.
DockerHub
DockerHub is a popular container registry run by the same organization that created Docker.
Base Images
Base images reduce time that it takes to run redundant operations.