We at dropbit are fond of docker

docker-logo

Build, Ship and Run Any App, Anywhere. We don’t have to worry about where our applications are running. If we neeed to do a server update, we don’t have to fear anymore. We can move away the applications running on this server very quickly. Then we can do server updates and afterwards if everything went well, we move back our applications to the updated server. With docker our application infrastructure became much simpler. dropbit therefore decided to share our experience with docker. From now on we will blog regularly about docker. In this first blog we just show some important commmands, you have to now. We are sure you will become fond of docker too. It’s just a matter of time.

Image Commands

pull an image from the docker hub

The docker hub is a big collection of base images , which you can use for your applications.

docker pull motiejus/systemd_centos7

show local images

docker images

build an image from an own Dockerfile

docker build -t myimage .
docker build -no-cache -t myimage .

delete an image

docker rmi myimage

delete all images

sudo docker rmi $(sudo docker images -f "dangling=true" -q)

container commands

show running containers

docker ps

show all containers

docker ps -a

run a container from an image

docker run --name myimage_instance -i -t myimage:latest

run a container in the background

docker run -d --name myimage_instance -i -t myimage:latest

stop a container

docker stop myimage_instance

delete a container

docker rm myimage_instance

delete all containers

docker rm $(docker ps -a -q)

miscellaneous

To get the container’s ip address, run the 2 commands

docker ps
docker inspect container_name | grep IPAddress

push an image to a local repository

docker tag bd393c80a9ca localhost:5000/dropbitbase
docker push localhost:5000/dropbitbase

linking container together

https://docs.docker.com/userguide/dockerlinks

This overview was thought just for our team initially. But why not sharing the list with you. If you have some more important commands to add to the overwiew, then just let us know.

Share on FacebookShare on LinkedInShare on Google+Tweet about this on TwitterEmail this to someone
PDF herunterladen
Posted in docker, Infrastructure