Last active
December 29, 2015 12:49
-
-
Save martinrusev/7673143 to your computer and use it in GitHub Desktop.
Docker examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List all images | |
docker images | |
docker run -i -t <image:tag> <command> | |
# Lists all changes | |
docker ps -l | |
# Commits the last change | |
docker commit <image_id> <image:tag> | |
# Mounts a directory from the host and runs a command | |
docker run -v /home/martin/Dropbox/:/var/scripts -i -t base:latest python /var/scripts/osdetector.py | |
# Run a python file on multiple distros | |
#!/bin/bash | |
declare -a arr=(tianon/debian:7.2 tianon/debian:6.0.8 base:latest centos:latest mattdm/fedora:latest) | |
for i in ${arr[@]} | |
do | |
docker run -v /home/martin/Dropbox/:/var/scripts -i -t $i python /var/scripts/osdetector.py | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment