# To do a "clean" build
docker-compose stop  
docker-compose rm -f  
docker-compose build --no-cache  
docker-compose up -d --force-recreate --remove-orphans  

# Docker workflow
* Create a Dockerfile (image definition)
* Build an image from the Dockerfile
** docker build -t {image name} .
* Build a container from the image
** docker run -d --name {container name} -p {port mapping} {image name}

# Image Management
docker images -a  
docker images -f dangling=true  
docker rmi $( docker images -q -f dangling=true) 
docker rmi $(docker images -a -q)  

# Container Management



# Install composer on CentOS
cd /tmp
curl -sS | php
sudo mv composer.phar /usr/local/bin/composer
Now you can to use the command composer globally.

# To build a Zend Expressive based project
composer create-project -s rc zendframework/zend-expressive-skeleton expressive-demo-app


Useful Docker Commands

docker --help
docker COMMAND --help

Image Management
docker image ls
docker image build
docker rm

Container Management
docker container ls
docker container run
docker start
docker stop
docker kill
docker rm

Docker Compose

# Delete all stopped containers
docker rm $( docker ps -q -f status=exited)



Subscribe to dan RSS