Skip to content

Instantly share code, notes, and snippets.

@tanish-kr
Last active November 13, 2018 08:09
Show Gist options
  • Save tanish-kr/8aeed3e8955622f9caba86f0d6979ca5 to your computer and use it in GitHub Desktop.
Save tanish-kr/8aeed3e8955622f9caba86f0d6979ca5 to your computer and use it in GitHub Desktop.
ECSでdocker-compose を利用する

Amazon ECS CLIインストール

https://docs.aws.amazon.com/ja_jp/AmazonECS/latest/developerguide/ECS_CLI_installation.html

sudo curl -o /usr/local/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-darwin-amd64-latest

MD5検証

curl -s https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-darwin-amd64-latest.md5 && md5 -q /usr/local/bin/ecs-cli

実行アクセス権

sudo chmod +x /usr/local/bin/ecs-cli

確認

ecs-cli --version

プロファイルの設定

  • AWS CLIとは別にプロファイル情報を設定する必要がある
ecs-cli configure profile --profile-name profile_name --access-key $AWS_ACCESS_KEY_ID --secret-key $AWS_SECRET_ACCESS_KEY

クラスタ設定

ecs-cli configure --cluster cluster_name --default-launch-type launch_type --region region_name --config-name configuration_name
  • Fargateタイプ
ecs-cli configure --cluster tutorial --region us-east-1 --default-launch-type FARGATE --config-name tutorial

クラスタ作成

ecs-cli up --vpc vpc-id --subnets subnet-id,subnet-id

コンテナ構築

ecs-cli compose --project-name projectname service up --create-log-groups --cluster-config config_name

クラスタ削除

ecs-cli down --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment