Skip to content

Instantly share code, notes, and snippets.

@rugor
Created December 16, 2015 17:15
Show Gist options
  • Save rugor/c47a58926d0c7fde7cec to your computer and use it in GitHub Desktop.
Save rugor/c47a58926d0c7fde7cec to your computer and use it in GitHub Desktop.
EC2 Migrate Mongo from localhost
// ssh into ec2 instance, info from 'instances' panel in ec2 dashboard
ssh -i /path/to/key.pem user@public_dns
// run command to show container ids and ports
docker ps
// prints something like the following
961ed99341b meteorhacks/meteord:base "/bin/sh -c 'bash $ME" 18 hours ago Up 18 hours 0.0.0.0:80->80/tcp demo
124a407de468 mongo "/entrypoint.sh mongo" 18 hours ago Up 18 hours 127.0.0.1:27017->27017/tcp mongodb
// connect to container by id to execute commands
docker exec -it 124a407de468 bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment