Made to quickly copy and paste commands.
$ docker stop $(docker ps -a -q)
$ docker rm $(docker ps -a -q)
$ docker rm $(docker ps -a -f status=exited -q)
$ docker stop $(docker ps -a -q) | docker rm $(docker ps -a -q)
Replace <container>
with name or id of container your want to view the logs of.
$ docker logs -f <container>
Replace <container>
with name or id of container your want to execute a command on.
Replace <command>
with the command you want to execute.
$ docker exec <container> <command>
Replace <container>
with name or id of container your want to execute a command on.
$ docker exec -it <container> sh
$ docker exec -it <container> bash
$ docker rmi $(docker images -f dangling=true -q)
$ docker rmi -f $(docker images -a -q)
$ docker rmi $(docker images -a -q)
$ docker build --tag image-name:latest .
docker volume rm $(docker volume ls -f dangling=true -q)
$ docker login -u user -p pass registry.example.com
$ docker push image-name:latest
$ docker login -u user -p pass
$ docker commit <container ID> <repo name>/<Name you want to give the image>
$ docker push <repo name>/<Name you gave the image>