docker pull tobert/dsc208
mkdir /srv/cassandra
ssh-keygen # hit enter a few times, accept all defaults
cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
docker run -d -v /root:/root tobert/dsc208
# Cassandra is now running. Now you need to ssh into the container
# to get access to tools such as nodetool.
# find the Docker ID
docker ps
# copy either the first column, or the last one
docker inspect $ID
# -- or --
ps -ef |grep dropbear
# copy the IP address
ssh $IP_ADDRESS
root@ptlab:~# docker run -d -v /root:/root tobert/dsc208
root@ptlab:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ec4a7ef04f88 tobert/dsc208:latest /bin/cassandra-runne 3 minutes ago Up 3 minutes 7000/tcp, 7199/tcp, 9042/tcp, 9160/tcp grave_hypatia
root@ptlab:~# docker inspect ec4a7ef04f88 |grep IPAddress
"IPAddress": "172.17.0.3",
root@ptlab:~# ssh 172.17.0.3
# get the ID of the container
docker ps
# kill it
docker kill $ID
root@ptlab:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ec4a7ef04f88 tobert/dsc208:latest /bin/cassandra-runne 3 minutes ago Up 3 minutes 7000/tcp, 7199/tcp, 9042/tcp, 9160/tcp grave_hypatia
root@ptlab:~# docker kill ec4a7ef04f88