Docker detach container

Docker container stop once the main program it started with stop running. If you start a docker container with console using -ti option, it stop when you disconnect. To avoid process getting stopped, you can detach from the console. This is done by pressing keys

Followed by

You can just press CTRL key, […]

Read More…

docker images

docker images command list all docker images (blueprints) available on your server.

[…]

Read More…

docker-compose

To run a project

Rebuild project and run

To stop all containers in the project

To see list of containers started by docker-compose, run

To get container id for a container started by docer-compose, run

Example

docker-compose: error while loading shared libraries Docker compose start container on boot […]

Read More…

Docker Delete all images

Before you can delete a docker image, you need to delete any container that is based on this image. So see how to delete all docker containers, see Delete all docker containers To list all available docker images, run

To just display image ID only, run with -q option

Now lets pass the […]

Read More…

Delete all docker containers

We need to use diff commands to to do this. First lets get list of all containers.

This will list all docker containers available. Before we can delete, we need to stop them. To stop all running containers, use

To delete all containers, run

[…]

Read More…

Backup and Restore Docker Image

To backup docker image, run

To restore a container, run

Backup and Restore a Docker Container To backup, run

To restore, run

docker […]

Read More…

Docker Run

Docker run command create container from IMAGE and run it.

Here we run nginx docker image.

-d = detach after starting container. -p 80:80 = port 80 on host machine is mapped to port 80 inside container. Now you will be able to access Nginx server by visiting IP of host machine. To […]

Read More…

docker

If you need to try docker on web without installing on your computer, use https://labs.play-with-docker.com Docker Install Install Docker on Ubuntu 16.04 Install Docker on Ubuntu 18.04 How to install Docker on CentOS 8 Docker Basics docker run docker exec docker login docker search docker build Backup and Restore Docker Image How to check if […]

Read More…