Optimizaci贸n Avanzada en Docker

1

La importancia de Aprender Docker

2

Desbloqueando el Poder de Docker

3

Construcci贸n de Im谩genes Multi-stage

4

Escaneo de im谩genes en Docker

5

Optimizaci贸n de Im谩genes de docker con Distroless

6

Compilaci贸n Multiplataforma

7

Gesti贸n de Cach茅 y Eficiencia en Builds

8

Reducci贸n de Dependencias y Minimizaci贸n de Tama帽o

9

Optimizaci贸n de Build Context y Reducci贸n de Transferencias

10

Explorando Docker Hub

Buenas Pr谩cticas en Docker

11

Uso Eficiente de Capas en Im谩genes Docker

12

Uso de .dockerignore para Optimizaci贸n

13

Eliminaci贸n de Archivos Temporales y Residuos en Docker

14

Agrega usuarios a tu imagen de docker

15

Mejores Pr谩cticas para Construcci贸n de Im谩genes

Instalaci贸n y Configuraci贸n en Entornos Multiplataforma

16

Despliegue de Docker en Azure y Entornos Locales

17

Publicar tu imagen a Container Apps de Azure

Redes Avanzadas y Balanceo de Carga

18

Modelos de Red en Docker

19

Exposici贸n y Publicaci贸n de Puertos en Docker

20

Balanceo de Carga con Docker

Automatizaci贸n de CI/CD

21

Ejecuci贸n de Scripts Multi-line en Docker

22

Automatizaci贸n de CI/CD con Docker

23

Estrategias Avanzadas de CI/CD en Docker

24

Publicando mi imagen de docker a la nube con CI/CD

Orquestaci贸n

25

Retomando Docker Compose

26

Secciones en un archivo Docker Compose

27

Agregando vol煤menes con Docker Compose

28

Secuencia de apagado

29

Introducci贸n a Docker Swarm

30

Replicaci贸n de Stacks con Docker Compose

31

De Docker a la nube

32

Orquestadores de contenedores

33

Costos de Docker

Develop

34

Introducci贸n a los devcontainers

You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesi贸n a prueba de IA

Antes: $249

Currency
$209
Suscr铆bete

Termina en:

0 D铆as
12 Hrs
53 Min
20 Seg

Despliegue de Docker en Azure y Entornos Locales

16/34
Resources

How to bring an optimized Docker image to the cloud with Microsoft Azure?

In the world of application development and deployment, efficiently managing Docker images is crucial to ensure a smooth and seamless workflow. We've already mastered the art of creating the perfect, optimized, production-ready image. Now it's time to give it the honor of taking to the skies and into the cloud. In this guide I'll show you how to do it with Microsoft Azure, although the process is quite similar in other providers such as AWS or Google Cloud.

What does our Docker image need before uploading to the cloud?

Before we dive into the technical steps, it's important to understand that:

  • Private container or registry: we will not use a public repository like Docker Hub. Instead, we will set up a private container registry.
  • Image preparation: Make sure your Docker image is optimized. This will not only improve performance, but also reduce costs by reducing the image size.

How to create a Container Registry in Azure?

We will start by creating a Container Registry in Azure, essential for hosting and managing Docker images.

  1. Access the Azure portal.
  2. Create a resource pool: imagine this as a workspace where you will host all the infrastructure needed for your project.
  3. Select "Create" and type "Container Registry" in the search bar.
  4. Name your registry: Make sure the name is unique. In this case, we use "Platzi Registry".
  5. Set the location: Usually a nearby region is chosen, such as the eastern United States.
  6. Choose the standard plan: This plan is suggested for most applications.
  7. Create the registry and wait a few minutes for it to fully deploy.

How to upload a Docker image to Azure Container Registry?

Now we will upload our Docker image from a local environment to the registry we just created:

  1. Log into Azure from the terminal:

    AZ ACR login -n DockerRegistryName.

This command authenticates the terminal with the container registry.

  1. Create the image in your local environment:

    cd front-end docker build -t NombreDelRegistry.azurecr.io/sitio-web:latest .

  2. Push the image to the Azure registry:

    docker push NombreDelRegistry.azurecr.io/sitio-web:latest

How to verify the upload to Azure Container Registry?

Go back to the Azure portal and go to the "Repositories" section inside your Container Registry.

  • Find your image under the name "website".
  • Here you can view the date and other details, such as tags (versions). This is vital to manage different versions of the same image without problems.

With these simple steps, we have efficiently managed our Docker images, making sure they are secure and ready to be used in any deployment tool that Azure offers. Go ahead, and keep exploring the vast world of cloud deployment!

Contributions 2

Questions 1

Sort by:

Want to see more contributions, questions and answers from the community?

Hola, logr茅 completar la clase, aunque me tom贸 2 horas jeheh. Por eso, escirbo este comentario y que te sirva a ti como a mi de gu铆a: **Disclaimer:** Yo cre茅 una cuenta de Azure y escog铆 el plan para estudiantes gracias a mi correo universitario. Esto es solo un aviso para prevenir cualquier confusi贸n. Luego de crear tu cuenta sigue los siguientes pasos: **1. Proceso para crear el grupo de trabajo:** 1.1 En el men煤 lateral izquierdo, selecciona "*Crear un recurso*". 1.2 En la barra de b煤squeda, escribe "*Grupo de recursos*". 1.3 Selecciona la primera opci贸n. 1.4 Completa los siguientes pasos: 1.4.1 En "Grupo de recursos", elige tu suscripci贸n (no s茅 si se puede con la versi贸n gratuita de azure). 1.4.2 Asigna un nombre al grupo de recursos, por ejemplo, "*contenedoresPlatzi*" o cualquier otro. Ten en cuenta que no podr谩s cambiarlo despu茅s. 1.4.3 Selecciona la ubicaci贸n donde se desplegar谩 tu servicio. Yo eleg铆 "*Brazil South" (Sudam茅rica)*. 1.5 Haz clic en "*Siguiente*" para acceder a la secci贸n de "*Etiquetas*". Aqu铆 debes asignar un nombre y un valor. Yo us茅 "*ambiente:devOps*". Luego, haz clic en "*Siguiente*". 1.6 Finalmente, haz clic en "Crear". 隆Y listo! A partir de aqu铆, solo escribo para recordarme los pasos. Ya puedes empezar la clase del profesor. **2. Crear un Docker en Azure:** 2.1 Dentro del grupo de trabajo, haz clic en "*Crear*" y selecciona "*Container Registry*". Luego, cr茅alo. 2.2 Los campos ya estar谩n configurados seg煤n el grupo de trabajo. Solo asigna un nombre y haz clic en "*Crear*". 2.3 隆Listo! Ya est谩 creado. **3. Subir la imagen de Docker a Services > Repositorios:** <u>Advertencia:</u> \- Debes instalar Azure CLI en tu PC: 3.0.1 Si tu PC no reconoce el comando `az --version`, sigue estos pasos: 3.0.1.1 Para instalar Azure CLI en Windows: <https://learn.microsoft.com/es-es/cli/azure/install-azure-cli-windows?tabs=azure-cli> 3.0.1.2 Para instalar Azure CLI en WSL2 u otras distribuciones de Linux: <https://learn.microsoft.com/es-es/cli/azure/install-azure-cli-linux> pivots=apt \- Aseg煤rate de que Docker Desktop o el demonio de Docker est茅n activos. \- Inicia sesi贸n con tu cuenta de Azure ejecutando el comando `az login`. Se abrir谩 una ventana donde debes iniciar sesi贸n. 3.1 En "*Overview*", copia el "*Login Serve*r" sin incluir "*.azurecr.io*". 3.2 Ejecuta el comando: `az acr login -n primerdocker`. 3.3 Con esto, ya tendr谩s acceso al registro de Azure. **4. Sube el proyecto a Azure container:** 4.1 Ve al curso de Docker: Fundamentos, clase 6. All铆 encontrar谩s el Dockerfile y la carpeta en los recursos. 4.2 Ejecuta el comando: `docker build -t primerdocker.azurecr.io/sitioweb:latest .` 4.3 Ejecuta el comando: `docker push primerdocker.azurecr.io/sitioweb:latest` **Links de ayuda:** \- Crear grupo de trabajo: <https://www.youtube.com/watch?v=aPDMRTPPkiA> Ojal谩 te haya sido de ayuda: \~ @camilocsoto
Una excelente opci贸n tambi茅n de registry es con GitLab. En mi trabajo lo estamos ocupando y la verdad es que es bastante sencillo y f谩cil de ocupar.