Created
July 3, 2023 20:34
-
-
Save patriciojlg/0f87b6dcdc363c3f773bac050f173186 to your computer and use it in GitHub Desktop.
aws deploy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Nombre del contenedor | |
# aws ecr create-repository --repository-name my-ecr-repo --region us-east-1 | |
nombre_contenedor="foton-epc" | |
# URL del repositorio de ECR | |
url_ecr="265174169506.dkr.ecr.us-east-1.amazonaws.com" | |
# Obtener el token de acceso de ECR y realizar el inicio de sesión en Docker | |
$(aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $url_ecr) | |
# Construir la imagen del contenedor | |
docker build -t "$nombre_contenedor" . | |
# Etiqueta del contenedor | |
etiqueta_contenedor="latest" | |
# Etiquetar la imagen del contenedor | |
docker tag "$nombre_contenedor:latest" "$url_ecr/$nombre_contenedor:$etiqueta_contenedor" | |
# Subir la imagen del contenedor a ECR | |
docker push "$url_ecr/$nombre_contenedor:$etiqueta_contenedor" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment