1. List Running Containers docker ps 2. Stop a Specific Container docker stop <container_id_or_name> 3. Stop Multiple Containers at Once docker stop container1 container2 container3 4. Stop All Running Containers docker stop $(docker ps -q) $(docker ps -q) returns a list of all running container IDs, which is then passed to the docker stop command. […]
Category: Docker
Dangling Images
What Causes Dangling Images? Dangling images usually occur in the following situations: 1.Rebuilding Images: When you rebuild a Docker image with the same tag, the old layers that are no longer used become dangling images. 2.Failed Builds: If a Docker build fails or is interrupted, it may leave behind dangling images. 3.Unreferenced Layers: Sometimes, images […]
Export and Import Postgresql Database
To import a database from another PostgreSQL database into a Docker PostgreSQL container, you can use the pg_dump and psql tools. Here’s a step-by-step guide to achieve this: Step 1: Export the Database from the Source PostgreSQL On the source PostgreSQL server, use the pg_dump tool to create a dump file of the database you […]
Install django+openlayer+postgres+postgis in docker
Below is a step-by-step guide to install and dockerize Django with OpenLayer, PostgreSQL, PostGIS, and the specified Python libraries on Ubuntu 22.04. This guide includes all the necessary Dockerfiles, scripts, and requirements files to help you set up the environment. Step 1: Install Docker and Docker Compose First, ensure that Docker and Docker Compose are […]