LoginSignup
8
8

More than 5 years have passed since last update.

Docker AWS Private Betaを試してみた

Last updated at Posted at 2016-07-30

cloudpack大阪の佐々木です。

ようやくDocker AWS Private Betaの案内が来ました。
さっそく試してみます。


Private Betaに申し込んでると、こんなメールが来ます。
AWSマネージメントコンソールにログインした状態で、Launch Stackをクリックします。

Kobito.eUxPyv.png

CloudFormationの画面になりますので、そのままNextを押します。

Kobito.4DRsjy.png

パラメータ指定の画面になるので、Swarm Managerの数と、Worker Nodeの数、SSH Keyを指定します。

Kobito.r13X0r.png

必要であればTagつけて、Stackを立ち上げます。

Kobito.Y28fRW.png

数分で立ち上がります。色々できてます。

Kobito.LiRRmf.png

EC2の画面を見るとManager3台、Worker5台が起動しています。

Kobito.2UwB9y.png

CloudFormationのOutputにELBのDNSNameとSSHの接続コマンドが出力されています。

Kobito.71UoOr.png

SSHでログインします。

$ ssh docker@Docker-ELB-SSH-XXXXXXXXX.ap-northeast-1.elb.amazonaws.com        
Warning: Permanently added 'docker-elb-ssh-XXXXXXXXX.ap-northeast-1.elb.amazonaws.com,54.64.xxx.xxx' (ECDSA) to the list of known hosts.
Welcome to Docker!
~ $

ノードを確認します。

~ $ docker node ls
ID                           HOSTNAME                                          STATUS  AVAILABILITY  MANAGER STATUS
04af8e5tyrv9io4ckjhmkbned    ip-192-168-33-83.ap-northeast-1.compute.internal  Ready   Active
2ko08xx6vo7zizh9sm0p8qvfo *  ip-192-168-34-26.ap-northeast-1.compute.internal  Ready   Active        Reachable
2vsilfqnmmuxmwbliwidtgmgf    ip-192-168-34-56.ap-northeast-1.compute.internal  Ready   Active
6pxbc9wgp88rladri7knnwlyh    ip-192-168-33-84.ap-northeast-1.compute.internal  Ready   Active
a5lo9tqj9zrgflqfq6lyj61yz    ip-192-168-34-27.ap-northeast-1.compute.internal  Ready   Active        Leader
apeabz8gpyky94tql94oz26oy    ip-192-168-33-60.ap-northeast-1.compute.internal  Ready   Active        Reachable
bmlt4nt24guq09z9giu20h4k5    ip-192-168-34-55.ap-northeast-1.compute.internal  Ready   Active
d4ur01nsyn6s9o3bkedp7h5zs    ip-192-168-34-54.ap-northeast-1.compute.internal  Ready   Active

Nginxのサービスを作って、5つコンテナをデプロイします。

~ $ docker network create -d overlay nginx-net
5wv1uhsyj6pdgqz3fq572n8x4
~ $ docker service create --name nginx --network nginx-net -p 80:80/tcp nginx
b6019v6kb4xiks5vb2ggz7htx
~ $ docker service scale nginx=5
nginx scaled to 5

psで確認します。

~ $ docker service ps nginx
ID                         NAME     IMAGE  NODE                                              DESIRED STATE  CURRENT STATE           ERROR
8zcebqe1ce1n316lz1tdtzavi  nginx.1  nginx  ip-192-168-34-27.ap-northeast-1.compute.internal  Running        Running 52 seconds ago
8f7ohxrbuhb3igbpdx5twnai7  nginx.2  nginx  ip-192-168-34-26.ap-northeast-1.compute.internal  Running        Running 42 seconds ago
24qkmubx4fl05towoe9ib87mv  nginx.3  nginx  ip-192-168-33-83.ap-northeast-1.compute.internal  Running        Running 38 seconds ago
7pt5so95wonry9qetz336laft  nginx.4  nginx  ip-192-168-34-55.ap-northeast-1.compute.internal  Running        Running 41 seconds ago
01p6oyxkg2pyqwapfhirz2e0b  nginx.5  nginx  ip-192-168-33-60.ap-northeast-1.compute.internal  Running        Running 39 seconds ago

ELBのDNSNameにアクセスしてみます。

Kobito.oFJchp.png

あっさりできました。

もうちょっとさわってみます。

8
8
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
8
8