Implement IaaS solutions, Containers Flashcards
What is ACR Tasks
Eliminates the need for local docker engine installation.
ACR tasks runs docker build operations in the cloud. Supports 3 step types:
build
push
cmd (used to run other docker commands)
The az acr build command in the Azure CLI takes a context (the set of files to build), sends it to ACR Tasks and, by default, pushes the built image to its registry upon completion.
All start with az acr
Group tasks in a yaml file for multi-step tasks, such as multiple registries involved.
What is meant by Fabric Clusters
A Service Fabric cluster is a network-connected set of virtual or physical machines into which your microservices are deployed and managed.
How to make a container from an app and then push to Azure
1) Start with a docker file (sequence of commands to build an image)
2) docker build to create a new image from dockerfile, use -t (tag, put name and version)
3) Create ACR if doesn’t exist (az acr create)
4) Get the loginServer name of the ACR: az acr show –name –query loginServer –output table
5) Sign into ACR with az acr login
6) Tag the image with the fully qualified name of your registry login server: docker tag azure-vote-front .azurecr.io/azure-vote-front:v1
7) Push image: docker push .azurecr.io/azure-vote-front:v1
CLI Command to Create Azure Container Registry
az acr create –resource-group –name –sku Basic –admin-enabled true
What is meant by container registry replication?
If you’ve configured your registry for geo-replication, when you push your image, your image is automatically replicated to each region with this single docker push command.
Can be done in the Portal or in Azure CLI:
az acr replication create –registry –location
True or false? Container Replication View can be looked up in Azure Portal
True.
Azure portal –> Replications for an Azure Container Registry displays a map that details current replications. Container images can be replicated to additional regions by selecting the regions on the map.
True of False? Container replication is possible by using the Portal and CLI?
True. Btw, geo-replication requires Premium tier registry.
Which of the following is not a benefit of using Azure Container Registry?
- Replicate container images to multiple Azure datacenters.
- Pull container images using any Docker container-related technology.
- Allow public access to container images for pull operations.
- Build container images without the need for locally installed Docker tools.
Allow public access to container images for pull operations.
Azure Container Registry is a private registry. Images cannot be accessed without authentication
Suppose you use container images to run compute workloads in multiple regions throughout the world. You plan to enable the geo-replication feature of Azure Container Registry to decrease the time required to provision an instance. In which regions should you configure the Azure Container Registry geo-replication feature?
- Place a container registry in the region closest to your development team.
- Place a container registry in each region where images are run.
- Place a container registry in every Azure region.
Place a container registry in each region where images are run.
Placing a registry in each region that runs the images will ensure network-close registry access everywhere it is needed.
In general, what is Azure Container Registry
Hosts container images, similar to Docker Hub. But only private images.
From Docs:
An Azure container registry stores and manages private Docker container images, similar to the way Docker Hub stores public Docker images.
You can use the Docker command-line interface (Docker CLI) for login, push, pull, and other operations on your container registry.
How does a basic Dockerfile looks like?
Every Dockerfile must start with the FROM instruction. The idea behind is that you need a starting point to build your image. You can start FROM scratch, scratch is an explicitly empty image on the Docker store that is used to build base images like Alpine, Debian and so on. Everything else is addon, modifiny the image
FROM node:8.9.3-alpine RUN mkdir -p /usr/src/app COPY ./app/ /usr/src/app/ WORKDIR /usr/src/app RUN npm install CMD node /usr/src/app/index.js
What is the Syntax for creating a Docker Tag
docker tag
What is required for a container instance to be exposed to the internet?
A DNS Name. The DNS name must be unique.
Azure Container Instances enables exposing your container groups directly to the internet with an IP address and a fully qualified domain name (FQDN).
When you create a container instance, you can specify a custom DNS name label so your application is reachable at customlabel.azureregion.azurecontainer.io.
az container create –resource-group myResourceGroup –name mycontainer –image mcr.microsoft.com/azuredocs/aci-helloworld –dns-name-label aci-demo –ports 80
How to specify the DNS name for a Container using CLI
–dns-name-label parameter
What are container restart policies?
Restart policies define how Containers should be restarted.
- Always (Default), good for long running tasks like web servers
- Never, containers run one time only
- OnFailure, for short tasks. Run at least once and restarted when exit code != 0