LoginSignup
1
1

More than 5 years have passed since last update.

t2.microのubuntu14.04.2をdocker-machineで立ち上げる

Last updated at Posted at 2015-06-27

参考

ユーザーのアクセスキーとシークレットアクセスキーを取得

2.png

4.png

シークレットアクセスキーはこのタイミングでしか確認ができない(?)
ので認証情報のダウンロードからダウンロードしておく。

グループの登録

1.png

1.1.png

2.png

3.png

42c5a2bd-174c-649d-6edc-aa5917858b07.png

VPCのIDを確認

スクリーンショット 2015-06-27 8.58.48.png

スクリーンショット 2015-06-27 9.00.23.png

スクリーンショット 2015-06-27 9.00.59.png

サブネットのIDを確認

スクリーンショット 2015-06-27 9.13.02.png

ami-idの取得方法

スクリーンショット 2015-06-27 10.11.46.png

  • ap-northeast-1
  • hvm-ssd

のものを探し、ami番号を控える。今回はami-20b6aa21

docker-machineでubuntu14.04.2の実行

export AWS_ACCESS_KEY_ID="xxxxxxxxxxxxxxxxxxxx"
export AWS_SECRET_ACCESS_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export AWS_VPC_ID="vpc-xxxxxxxx"
export AWS_SUBNET_ID="subnet-xxxxxxxx"
docker-machine --debug create \
  --driver amazonec2 \
  --amazonec2-instance-type t2.micro \
  --amazonec2-ami ami-20b6aa21 \
  --amazonec2-region ap-northeast-1 \
  --amazonec2-root-size 16 \
  \
  --amazonec2-access-key $AWS_ACCESS_KEY_ID \
  --amazonec2-secret-key $AWS_SECRET_ACCESS_KEY \
  --amazonec2-vpc-id $AWS_VPC_ID \
  --amazonec2-subnet-id $AWS_SUBNET_ID \
  --amazonec2-zone c \
  test-instance1

2分ほど待つ。

docker-machine ssh test-instance1
グローバルIP確認
curl http://ifconfig.me

t2.microの性能

port開放

スクリーンショット 2015-06-27 10.25.29.png

スクリーンショット 2015-06-27 10.26.00.png

エラー編

docker-machine ls で出てくる情報

  • ~/.docker/machine/machines/マシン名

ユーザにグループ権限が不足している場合

Error creating machine: Problem with AWS API call: Non-200 API response: code=403 message=You are not authorized to perform this operation.
You will want to check the provider to make sure the machine and associated resources were properly removed.

$AWS_ACCESS_KEY_IDに対応するユーザのグループ権限を見直す。

キーペアの削除方法

Error creating machine: Machine test-instance3 already exists
You will want to check the provider to make sure the machine and associated resources were properly removed.

スクリーンショット 2015-06-27 10.28.08.png

スクリーンショット 2015-06-27 10.28.18.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1