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 CTRL + P Followed by CTRL + Q You can … Read more

docker images

docker images command list all docker images (blueprints) available on your server. root@ok:~# docker images REPOSITORY TAG IMAGE ID CREATED SIZE gcr.io/tensorflow/tensorflow latest 04f0b1131389 9 months ago 1.13GB tensorflow/tensorflow 1.1.0 04f0b1131389 9 months ago 1.13GB root@ok:~#

docker-compose

To run a project docker-compose up -d Rebuild project and run docker-compose up –build To stop all containers in the project docker-compose down To see list of containers started by docker-compose, run docker-compose ps To get container id for a container started by docer-compose, run docker-compose ps -q NAME_OF_SERVICE Example root@ee:/opt/easyengine/services# docker-compose ps Name Command … 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 docker images To just display image ID only, run with -q option docker images -q Now … Read more

Delete all docker containers

We need to use diff commands to to do this. First lets get list of all containers. docker ps -a -q This will list all docker containers available. Before we can delete, we need to stop them. To stop all running containers, use docker stop $(docker ps -q) To delete all containers, run docker rm … Read more

Docker Run

Docker run command creates a container from an image and runs it. Here we run the nginx Docker image. -d = detach after starting the 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 … Read more

Running MySQL inside docker

On a Cpanel Server with an old version of PHP, one of the applications requires MySQL 5.6 to work. Since the PHP version is no longer supported, updating MySQL using WHM will upgrade PHP to one of the supported versions, which may break existing sites. So I decided to install MySQL inside docker. First, create … 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 Docker Basics Docker Delete Conatiner/Image Run Application in Docker Container Creating Docker Images Docker Tools Using Docker To install docker, run Install docker compose Check docker is working To list all running docker containers