Create a Docker containers in base a Image pre-configured with centos, and use Ansible for Application Deployment + Configuration Management + Continuous Delivery.
- Docker (last version for your SO)
- Ansible (last version)
- SSH client
- Centos 6.7
- SSH deamon
- httpd
- php5.3 stable/php5.5 unstable/php5.6
- mysqld 5.5
- composer
- drush
- drupal console
- vim
- git
- wget
- tar
- curl
- add autorized keys
- ruby
- compass
docker pull igasi/drupal8centos7base:latest
docker run --privileged=true -d -t -P -v /path/to/code/project:/var/www/html:rw --name project_name igasi/drupal8centos67base:latest
# Clone repository
git clone https://github.com/igasi/ansible_centos_drupal8.git
cd path/to/ansible_centos_drupal8
# Add rsa key to autorized keys
cp files/example_authorized_keys files/authorized_keys
cat ~/.ssh/id_rsa.pub >> files/authorized_keys
# Build a docker image base
docker pull centos
docker build -t base .
#Check image base creation
docker images base
# Run a container specific for project with share code
docker run -d -t -P -v /path/to/code/project:/var/www/html:ro|rw --name «project_name» base
# Check ssh conection
docker ps
docker inspect «project_name» | grep IPAddress
ssh root@«IPAddress»
# Into container
exit
# Configure hosts
echo «IPAddress» >> hosts
# Get roles from ansible galaxy
ansible-galaxy install -p roles/ rvm_io.rvm1-ruby
git clone [email protected]:geerlingguy/ansible-role-php.git roles/ansible-role-php
#Note: Please review build.yml for select version of php or custom install
# Run ansible
ansible-playbook build.yml -i hosts
docker ps
docker commit <exiting-container> <hub-user>/<repo-name>[:<tag>]
Note: The docker image is build based on existing container with current status
- Password for root is root
- mysql: db=drupal8 user=drupal8 pass=drupal8
- Vefiry the last version of docker and ansible (posible troubles with backward versions in ssh)