Practice Test

Container images can run without a host operating system.

  • True
  • False

Answer: False

Explanation: Containers are lightweight because they do not require the extra load of a hypervisor, but they run directly within the host machine’s kernel.

Which AWS service is used to store and retrieve Docker images?

  • AWS S3
  • AWS EC2
  • AWS ECR
  • AWS Fargate

Answer: AWS ECR

Explanation: Amazon Elastic Container Registry (ECR) is a fully-managed Docker container registry that makes it easy for developers to store, manage, and deploy Docker container images.

DockerFile is indispensable to create a container image.

  • True
  • False

Answer: False

Explanation: DockerFile can be used to create images, but it’s not the only way. For instance, one can also use commands like ‘docker commit’ to create images without a DockerFile.

Which AWS service allows users to manage Kubernetes?

  • AWS Fargate
  • AWS EKS
  • AWS ECS
  • None of the above

Answer: AWS EKS

Explanation: Amazon EKS (Elastic Kubernetes Service) is a managed service that allows users to run Kubernetes on AWS.

Development in Docker is only possible in Linux environments.

  • True
  • False

Answer: False

Explanation: Docker can run on various platforms like Linux, Windows, and Mac OS.

A single Docker container can run multiple applications at once.

  • True
  • False

Answer: False

Explanation: Containers are designed to run a single process per container. The ‘one process per container’ rule helps make containers lightweight and portable and facilitates their orchestration.

What are the benefits of using Container images? (Multiple Select)

  • Portability
  • Scalability
  • Environment consistency
  • Increased complexity

Answer: Portability, Scalability, Environment consistency

Explanation: Container images provide numerous benefits such as portability (run on different platforms), scalability (easy to scale up and down), and environment consistency (maintain consistency across different environments). But they do not inherently increase complexity; in fact, they are designed to simplify application deployment and scaling.

Docker is the only technology available for using containers.

  • True
  • False

Answer: False

Explanation: Although Docker is the most known and widely used, it is not the only container technology available. Other alternatives include rkt, LXC, and containerd.

Container images are made up of multiple layers.

  • True
  • False

Answer: True

Explanation: A container image is built up from a series of layers. Each layer represents an instruction in the image’s Dockerfile. Each layer except the last one is read-only.

In AWS, you cannot use third-party registries with Amazon ECS or Amazon EKS.

  • True
  • False

Answer: False

Explanation: While AWS has its container image registry (ECR), you can still use third-party Docker registries with both Amazon ECS and Amazon EKS.

Interview Questions

What are container images in AWS?

Container images are lightweight, stand-alone, executable packages that include everything needed to run a piece of software, including the code, a runtime, libraries, environment variables, and config files.

In AWS, where are Docker container images stored and managed?

In AWS, Docker container images are stored and managed in Amazon Elastic Container Registry (ECR).

What does the Amazon Elastic Container Registry (ECR) provide to AWS users?

Amazon ECR provides a secure, scalable, and reliable registry for Docker and Open Container Initiative (OCI) images. It integrates with Amazon ECS and Amazon EKS for simplified workflow and application development.

Can you share Docker images across multiple AWS accounts in the Amazon ECR repository?

Yes, Docker images can be shared across multiple AWS accounts in the Amazon ECR repository, provided that appropriate access permissions have been set.

How are Docker images secured in Amazon ECR?

Docker images in Amazon ECR are secured using AWS Identity and Access Management (IAM) to control access. Additionally, Amazon ECR uses security through encryption, both for images at rest in the repository and for data transmission over networks.

Is Amazon ECR region-specific?

Yes, Amazon ECR is region-specific. The data in an Amazon ECR repository lives in a specific AWS region and does not automatically replicate across to other regions.

What AWS service can be used to automate the deployment of containers across multiple regions?

AWS CodePipeline, coupled with AWS CodeDeploy, can be used to automate the deployment of containers across multiple regions.

Can you assign AWS Identity and Access Management (IAM) policies to a Docker image in Amazon ECR?

No, IAM policies are applied to users, roles, and resources, not directly to Docker images. However, these policies can control who has the ability to access and manage Docker images within Amazon ECR.

Can Amazon Elastic Container Registry (ECR) be integrated with AWS CloudTrail?

Yes, Amazon ECR is integrated with AWS CloudTrail. This allows you to capture all API calls for Amazon ECR as events, including calls from the Amazon ECR console and from code calls to the Amazon ECR APIs.

What are the types of container images that Amazon Elastic Container Registry (ECR) supports?

Amazon ECR supports both Docker Image Manifest V2, Schema 2 and the OCI (Open Container Initiative) image format.

Can Amazon Elastic Container Registry (ECR) automatically scan your container images for vulnerabilities?

Yes, Amazon ECR has a feature that can automatically scan your Docker container images for vulnerabilities when they are pushed to the repository.

Can I use my own private registry for container images rather than using Amazon ECR?

Yes, you can use your own private registry for container images. However, you will need to manage the scalability, reliability, security, and performance of the registry by yourself, which is inherently taken care by Amazon ECR.

What happens if I try to push an image to Amazon ECR that’s larger than the supported limit?

If you try to push an image that exceeds the supported limit, the Image push process fails, and Amazon ECR returns an error message.

How many images can I store in an Amazon ECR repository?

By default, you can store up to 1,000 images in an Amazon ECR repository. However, you can request an increase in this limit by submitting a request through the AWS Service Quotas console.

How is version control of a Docker image achieved in Amazon ECR?

In Amazon ECR, each Docker image is given a unique image tag, which can be used for version control. If you do not provide a unique tag, by default the tag ‘latest’ is assigned.

Leave a Reply

Your email address will not be published. Required fields are marked *