9 examples for docker

{{ score }}
  # list all docker containers
# - assumes the following alias exists
#   alias docker="sudo docker -H tcp://localhost:2375"
# tip a bro some bitcoin 1LL1Q1cSSTDPZxWXp2XcDWfZkHGb7rps6n
docker ps -a
        
{{ score }}
  # list all docker images
# - assumes the following alias exists
#   alias docker="sudo docker -H tcp://localhost:2375"
# tip a bro some bitcoin 1LL1Q1cSSTDPZxWXp2XcDWfZkHGb7rps6n
docker images -a
        
{{ score }}
  # Start bash in a new ubuntu container.
# This will download the ubuntu image if it's not already installed.
docker run -i -t ubuntu /bin/bash
        
{{ score }}
  # minimum docker command
# - will display help
# - -H is the docker host daemon tcp endpoint, usually tcp://localhost:2375
# tip a bro some bitcoin 1LL1Q1cSSTDPZxWXp2XcDWfZkHGb7rps6n
sudo docker -H tcp://localhost:2375
        
{{ score }}
  # run bash on a running container
docker exec -i -t container /bin/bash
        
{{ score }}
  # To be able to run on OS X GUI apps you have to be running into another terminal: socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
# And you start the docker container with:
docker run --rm --name spotify -e DISPLAY=192.168.99.1:0  jess/spotify
        
{{ score }}
  # Remove all the images containing TOKEN in their names
docker rmi -f $(docker images | grep 'TOKEN' | awk {'print $3'})
        
{{ score }}
  # Short for the following set of commands:
# docker rm -v $(docker ps -aq -f 'status=exited')
# docker rmi $(docker images -aq -f 'dangling=true')
# docker volume rm $(docker volume ls -q -f 'dangling=true')
docker system prune
        
{{ score }}
  # Visualizar el ID del contenedor completo
docker ps -a --no-trunc