Difference between revisions of "Docker Swarm on AWS"

From berki WIKI
Jump to: navigation, search
Line 1: Line 1:
 +
https://docs.docker.com/machine/examples/aws/#step-1-sign-up-for-aws-and-configure-credentials
 +
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.html
 +
 +
 +
https://console.aws.amazon.com/iam
 +
:[[File:ClipCapIt-180712-223124.PNG]]
 +
 +
 +
 +
~/.aws/credentials
 +
<pre>
 +
[default]
 +
aws_access_key_id = AKIAJ622JUHS4RIJOI3A
 +
aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXX
 +
</pre>
  
  

Revision as of 20:31, 12 July 2018

https://docs.docker.com/machine/examples/aws/#step-1-sign-up-for-aws-and-configure-credentials https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.html


https://console.aws.amazon.com/iam

ClipCapIt-180712-223124.PNG


~/.aws/credentials

[default]
aws_access_key_id = AKIAJ622JUHS4RIJOI3A
aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXX


# docker-machine create --driver amazonec2 \
--amazonec2-instance-type "t2.micro" \
--amazonec2-region ap-southeast-1 \
--amazonec2-open-port 8080 docker-sendbox
Running pre-create checks...
Creating machine...
(docker-sendbox) Launching instance...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env docker-sendbox
ClipCapIt-180712-221828.PNG


ClipCapIt-180712-222037.PNG
ClipCapIt-180712-222143.PNG


# docker-machine ls
NAME             ACTIVE   DRIVER      STATE     URL                         SWARM   DOCKER        ERRORS
docker-sendbox   -        amazonec2   Running   tcp://54.169.84.170:2376            v18.05.0-ce   


# docker-machine ssh docker-sendbox
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-1020-aws x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

184 packages can be updated.
92 updates are security updates.

ubuntu@docker-sendbox:~$ 


ubuntu@docker-sendbox1:~$ sudo docker run -dit --name apache -p 8080:80 httpd:2.4
Unable to find image 'httpd:2.4' locally
2.4: Pulling from library/httpd
1c7fe136a31e: Pull complete 
72d2d593b3a7: Pull complete 
96cd507e10fd: Pull complete 
ec6bb3492a46: Pull complete 
0ea3a980fa47: Pull complete 
ebe42c0aa1a8: Pull complete 
a640bae86fe0: Pull complete 
Digest: sha256:963ecd717afb125c7a867d82d6935930bb93acc5078ea8bc37854d4b4de766d9
Status: Downloaded newer image for httpd:2.4
21b8f150ed88434b73a95e47a4a07c78859965c19325b08578b11aca3dcc4761


ubuntu@docker-sendbox:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND              CREATED             STATUS              PORTS                  NAMES
2d6843f4f464        httpd:2.4           "httpd-foreground"   41 seconds ago      Up 40 seconds       0.0.0.0:8080->80/tcp   apache


ClipCapIt-180712-222716.PNG