Skip to main content

Docker containers list

View a list of the Docker containers up

docker ps

List all containers

docker ps -a

To view a php version within a container

docker exec {container id} php -v


Docker build PHP

docker build -t php-8.1.112-apache-2.4.54-bullseye -f .


Build Docker using tag and file

Build Docker using the tag php8.1.12-local and file Dockerfile.base.local

docker build -t php8.1.12-local -f Dockerfile.base.local .

Post running this command compose the instance

docker compose up -d

To shut down a Docker instance

docker compose down


Clean up Docker image and containers

Remove Docker images handing around

docker image prune -y

Remove Docker all stopped containers

docker container prune -y


Related articles

Andrew Fletcher15 Feb 2022

Mariadb hangs on start up in Docker

Running Docker and attempting to install a web proxy environment where I'm attempting to create local web set up the consist of Drupal 9 with Composer + Docker-compose + Nginx + MariaDB + PHP8.1 However, when I run the command docker-compose up The terminal hangs at Version:...