Vagrant

#Vagrant is a tool to manage virtual environments. It allows you to run headless (no GUI) Virtual Machines.

#Common Commands
*vagrant --version
*vagrant status
*vagrant up (will start the VM)
*vagrant ssh (will log you into the VM)

##Box management
*vagrant init <box> <box_url>
*vagrant box list | add | remove
*vagrant up | destroy [--force] | halt [--force] | suspend
*vagrant status
*vagrant reload

Tags: 

docker

# 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}

Tags: 

composer

# Install composer on CentOS
cd /tmp
curl -sS https://getcomposer.org/installer | 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

Tags: 

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
=======================================
docker-compose

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

Tags: 

Pages

Subscribe to dan hagarty.com RSS