This is utility script in order to push image to aws ecr service.
Aws Login use get-authorization-token
method in order to authentication.
You can;
- You build image without push to aws for your local development
- You build and push to aws and you can see image in the ecr service.
On the fly (I recommend) running.
bash < (curl -s <raw aws-ecr.sh file URL>) [OPTIONS] COMMAND
For example;
bash <(curl -s https://raw.githubusercontent.com/omeroot/aws-ecr.sh/master/aws-ecr.sh) [OPTIONS] [COMMAND]
If you want to pass options when running script, you could create .env file and define variables which using in script.
.env file content
URI=<ecr uri>
REPO=<image repository uri>
APP_NAME=<image name>
SSH_KEY=~/.ssh/<your_key_rsa>
SSH_KEY
is optional
OPTIONS | DESCRIPTION |
---|---|
-t | --tag | Tag of your docker image (beta, latest, version x.x.x ...) |
-r | --repository | Your aws image repository (You should push same image to same repository) |
-n | --name | Image name |
-u | --uri | Aws ecr url created according to your aws account. |
COMMAND | DESCRIPTION |
---|---|
release | Push image to aws ecr |
build | Build image with tag version and tag latest |
If you dont pass no command script only build your image according to given options.