Skip to content

Instantly share code, notes, and snippets.

View m-wendler's full-sized avatar

Mike m-wendler

View GitHub Profile

Keybase proof

I hereby claim:

  • I am m-wendler on github.
  • I am mwendler (https://keybase.io/mwendler) on keybase.
  • I have a public key ASBwk4WpDZ-VLhvJ_drkE70hhrlQU0MyMP3sevgOvbg69wo

To claim this, I am signing this object:

@m-wendler
m-wendler / customize_the_docker_ps_command_output
Created April 6, 2016 20:39
customize the 'docker ps' command output
# customize the 'ps' command (see https://docs.docker.com/engine/reference/commandline/ps/)
docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.Command}}
# I also put it into an alias:
alias dps='docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.Command}}"'
@m-wendler
m-wendler / rm_all_dangling_images_in_one_go
Created March 29, 2016 10:40
rm all dangling images in one go
docker rmi $(docker images -q -f dangling=true)
@m-wendler
m-wendler / list_all_dangling_images
Last active March 29, 2016 10:38
list all dangling images
# '-q' will list just IDs
docker images -q -f dangling=true
@m-wendler
m-wendler / rm_several_docker_hosts_in_one_go
Created March 26, 2016 08:37
rm several docker hosts in one go
# stop and remove all docker hosts with these names
for H in staging prod; do
docker-machine stop $H;
docker-machine rm -y $;H # pass -y to automatically confirm the removal
done
# OR: one-liner
for H in staging prod; do docker-machine stop $N; docker-machine rm -y $N; done
@m-wendler
m-wendler / rm_all_exited_docker_containers_in_one_go
Created March 26, 2016 08:30
remove all exited docker containers in one go
# the '-q' option returns just the container IDs
docker rm $(docker ps -a -q -f status=exited)
@m-wendler
m-wendler / list_all_exited_docker_containers
Created March 26, 2016 08:22
list all exited docker containers
# '-f' lets you filter for a particular status
docker ps -a -f status=exited
@m-wendler
m-wendler / several_docker_hosts_in_one_go.txt
Last active March 26, 2016 08:38
create several docker hosts in one go
# create 3 docker hosts on virtualbox
for N in 1 2 3; do
docker-machine create -d virtualbox node-$N;
done
# OR: one-liner:
for N in 1 2 3; do docker-machine create -d virtualbox node-$N; done