systemadmin.es > AWS > AWS Amazon EC2 Container Registry: Añadir imagen de docker

AWS Amazon EC2 Container Registry: Añadir imagen de docker

Para poder subir imagenes de docker a ECR deberemos tener configurado el AWS CLI

Primero configuramos aws-cli mediante aws configure:

$ aws configure
AWS Access Key ID [None]: AAAAAAAAAAAAAAAAAAAA
AWS Secret Access Key [None]: 44444444444444444444444444444444444444444
Default region name [None]: us-east-1
Default output format [None]: json

Mediante ecr get-login obtendremos el comando a ejecutar para hacer login al registry:

$ aws ecr get-login
docker login -u AWS -p CiBwm0YaISJeRtJm5n1G6uqeekXuoXXPe5UFce9Rq8/14xK+BgEBAgB4cJtGGiEiXkbSZuZ9RurqnnpF7qF1z3uVBXHvUavP9eMAAAMVMIIDEQYJKoZIhvcNAQcGoIIDAjCCAv4CAQAwggL3BgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDB2Fr3/VSHD4/MMMMMMMMMMMMMMMMMMMMMMMM+u4ZQcuyFdxs/O0QBaYbGN9vRSsIr7h0uT7zN4lqbL1PPivnWMvqNFcO3rbK98dq6jzvLDBuHfggHw3OGghfn0bWJi0iUKxijehq5B4/EZrHtdG5INDVlAVvbuytv4AMzB6DrX5c3BX4Eyk2MVNBQ0aOxVhSbqLRzvuCBo0mnjjM1GrPb8gM8flizigRu6XLCYyK2V4rbCYL3PmQYifIq+GfgwgN6TZcBfuqgzJp0XZ/OCcYLs6ErNae4NtFAJa3S+00000000000000000000+9/7j1BbuH4lS8d8bPgSzJ38quP5NuWJ7a4mHmCD6T1hpEe0XfkA6NKwlYPPkFqdY9Ss/CNXXm3Y4urXsLSueb5xVAtpxjwVK0kQiUpIu1lIE5QCWkmHfd4ka2CJSnU642rt9ukCOjPaJA7iK7hvL0J4rIVDDCfStzhK+WV0VMhWQ3cEPa4GkFwB2neG72gQhx9Zf754hvre/MMMMMMMMMMMMM/kQrp4c3F7Me+okzto4KT/TFLxn2HOGsSLdvfXmES6ZRvATPQg3GKIUv0JnMbIZUcq5tX3EpGmk+gx6/JD2Ba5a824TQlzxOQJKxwXgmpMIRVpV+7q6qgVURdqYRamGvHdSeireYasczaLbPqICNlVl8zNr2uZmi1DfzOs4hRK9ZnTmS7Xpro9S0sXccynSC7GO/Ykp4Mt8zCfqAvyjxtFR9fLm/UIF5tEp7zAEYqiQ6tNmT2jB2H1WBbdn3SmFZdDeZxwIHs -e none https://111111111111.dkr.ecr.us-east-1.amazonaws.com

Deberemos copiar el comando y ejecutarlo:

$ docker login (...)

Ahora en la interfaz de AWS deberemos crear el respositorio:

Creamos repositorio ECR

Creamos repositorio ECR

Una vez tengamos creado el respositorio nos indicará cómo usarlo:

Instrucciones uso repositorio

Instrucciones uso repositorio

Primero creamos un tag:

$ docker tag puppetmaster:latest 111111111111.dkr.ecr.us-east-1.amazonaws.com/puppetmaster:latest 

Para luego hacer el push:

$ docker push 111111111111.dkr.ecr.us-east-1.amazonaws.com/puppetmaster:latest
The push refers to a repository [111111111111.dkr.ecr.us-east-1.amazonaws.com/puppetmaster] (len: 1)
79d7b9432043: Image already exists 
638844cf3b3e: Image successfully pushed 
94ce0474d6df: Image successfully pushed 
e83f0688b376: Image successfully pushed 
7d216d3d3237: Image successfully pushed 
99a00c442d1a: Image successfully pushed 
95b3bcb9cdce: Image successfully pushed 
11f227ec497e: Image successfully pushed 
724e5f9bb2db: Image successfully pushed 
980b6ecbf6c1: Image successfully pushed 
bbbca2c6e849: Image successfully pushed 
b857b5dc39f5: Image successfully pushed 
ed5bc1beeb0b: Image successfully pushed 
(...)

Son instrucciones equivalentes a las que hacemos para subir una imagen a un private registry

Deja un comentario:

XHTML - Tags permitidos:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>