Kamal2 AWS ECR docker registry/repository
kamal
docker
aws
AWS CLI profile in my laptop .aws/credentials is named moments configured in eu-west-1
aws ecr create-repository --repository-name mysupercoolappdockerrepo --region eu-west-1 --profile moments
# .kamal/secrets
KAMAL_REGISTRY_PASSWORD=$(aws ecr get-login-password --region eu-west-1 --profile moments)
RAILS_MASTER_KEY=$(cat config/master.key)
# config/deploy.yml
# Name of your application. Used to uniquely configure containers.
service: mysupercoolappdockerrepo
image: mysupercoolappdockerrepo
registry:
server: 123456789012.dkr.ecr.eu-west-1.amazonaws.com
username: AWS
password:
- KAMAL_REGISTRY_PASSWORD
Sidenote (optional)
if you have volume in config/deploy.yml e.g.:
volumes:
- "/var/apps/mysupercoolappdockerrepo:/rails/storage"
Make sure folder /var/apps/mysupercoolappdockerrepo and all files and folders in it have user 1000:1000
chown -R 1000:1000 /var/apps/mysupercoolappdockerrepo
Why ? because docker is built with 1000:1000 user group (check your Dockerfile if this is the case)