You are here: Home / presentations / Docker / Cheat Sheet

Cheat Sheet

by Alan Milligan last modified Mar 23, 2015 02:42 AM

Images/Registry

 

# listing images available within your engine
$ docker images

# finding something on docker registry
$ docker search bastionlinux

# installing into your engine
$ docker pull milligan/bastionlinux

# publish to your private registry
$ docker tag IMAGEID bastionlinux
$ docker push localhost:5000 bastionlinux

# remove an image from your registry
$ docker rmi IMAGEID

# upload an image
$ tar --numeric-owner -C /mnt/bla -c . | docker import - bastionlinux:19

 

Containers/Running

 

# what is running ...
$ docker ps

# running a one-shot process
$ docker run bastionlinux-monit:19 echo I just executed a one-shot payload ...

# running an interactive shell
$ docker run -i -t bastionlinux-monit:19 /bin/bash

# running a daemon
$ docker run --privileged -d -p 27017:27017 mongodb:2.8.0 /usr/bin/mongod --dbpath=/var/lib/mongodb #--storageEngine=wiredtiger

# stopping a daemon
$ docker kill COMMITID

# cleaning up file systems after docker
$ docker ps --all | grep -v ^CONTAINER | cut -d ' ' -f 1 | xargs docker rm