I've been playing around with various docker and docker-machine tutorials. Here is the docker-machine setup
$ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS aws-sandbox * amazonec2 Running tcp://188.8.131.52:2376 v1.12.0 dev - virtualbox Running tcp://192.168.99.100:2376 v1.12.0
I understand a docker-machine to be a host where 1 or more docker containers can run. In my case I have docker-machine running on my laptop and another on EC2.
Meanwhile, I have set the EC2 instance to the default, by the following command
eval $(docker-machine env aws-sandbox)
This seems to have worked, as the aws-sandbox is marked as
Now I have tried to load docker containers into the docker-machine, but I am not sure if this is working.
$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES fd34916854bf orchestratingdocker_web "env" About an hour ago Restarting (0) 9 minutes ago 8000/tcp orchestratingdocker_web_run_2 f98b49ad026a orchestratingdocker_web "/usr/local/bin/pytho" About an hour ago Restarting (0) 23 minutes ago 8000/tcp orchestratingdocker_web_run_1 4d2322aa402e orchestratingdocker_nginx "/usr/sbin/nginx" About an hour ago Up About an hour 0.0.0.0:80->80/tcp orchestratingdocker_nginx_1 1b4386bcccf2 orchestratingdocker_web "/usr/local/bin/gunic" About an hour ago Up About an hour 8000/tcp orchestratingdocker_web_1 9190ffd622ad postgres:latest "/docker-entrypoint.s" About an hour ago Up About an hour 0.0.0.0:5432->5432/tcp orchestratingdocker_postgres_1 380d19e5c239 kitematic/hello-world-nginx "sh /start.sh" About an hour ago Up About an hour 0.0.0.0:8000->80/tcp webserver
I cannot seem to connect to any of these containers using any of:
Do the Docker containers sit inside the docker-machine as I assume? If so, how can I list what is running inside which machine and why cannot I access the running web servers?