2016-10-28
how 2 get image via aws ecr on docker / docker-compose?
aws ecr get-logincommand providesdocker loginto aws ecr- sample shell as follows
# check credentails
: "${AWS_ACCESS_KEY_ID?env empty}"
: "${AWS_SECRET_ACCESS_KEY?env empty}"
: "${AWS_DEFAULT_REGION?env empty}"
echo "docker login via aws ecr command"
#eval "$(docker-machine env default)"
$(aws ecr get-login --region $AWS_DEFAULT_REGION)
after docker login passes, docker / docker-compose can handle docker images on aws ecr.
token via get-login command is valid for only 12 hours.
2016-10-24
get stdin in shell
while read line
do
result=$result$line
done < "${1:-/dev/stdin}"
trim last charactor of variables
result=hogehoge
echo ${result:0:${#result}-1}
2016-10-20
terraform cheetsheat
- terraform loads all of
.tffile terraform planshows what changes will apply to infra (aka dry-run)terraform applycreates “real” resourcesterraform showshows actual infra statusterraform plan -destroyshows what resources will destroyterraform destroydestroy infra