Useful Docker Commands

Status of docker container:
docker ps
docker image list
docker ps -a
docker images
Amount of used docker space:
docker system df
Reclaim space:
docker system prune
Other Examples
docker rm $(docker ps -a -f status=exited -q)
docker run –name my-hello hello-world
docker run -t -d -p 127.0.0.1:9980:9980 -e ‘domain=cloud\\.mydomain\\.com’ –restart always –cap-add MKNOD collabora/code
docker run -t -d -p 127.0.0.1:9980:9980 -e ‘username=admin’ -e ‘password=PassWord’ -e ‘domain=cloud\\.mydomain\\.com’ –restart always –cap-add MKNOD collabora/code

docker run – Runs a command in a new container.
docker start – Starts one or more stopped containers
docker stop – Stops one or more running containers
docker build – Builds an image form a Docker file
docker pull – Pulls an image or a repository from a registry
docker push – Pushes an image or a repository to a registry
docker export – Exports a container’s filesystem as a tar archive
docker exec – Runs a command in a run-time container
docker search – Searches the Docker Hub for images
docker attach – Attaches to a running container
docker commit – Creates a new image from a container’s changes

Issuing updates for Collabora Office:
docker ps
docker stop <id from “docker ps”>
docker pull collabora/code
docker rm <id from “docker ps”>
docker run -t -d -p 127.0.0.1:9980:9980 -e “domain=mycloud\\.mydomain\\.com” –restart always –cap-add MKNOD collabora/code
service nginx restart

Leave a Reply