Skip to content

A project that mimics Acquia Drupal environment into Docker containers.

License

Notifications You must be signed in to change notification settings

halisonfernandes/Docker4Acquia

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker4Acquia

This project intends to be a containerized solution that mimics Acquia environment for multiple purposes.

The source code is available under GPLv3 at GitHub in this link.

The solution utilizes the same versions of softwares, packages, modules and underlying operating system as Acquia. We do our best efforts to keep it updated according to the published platform infrastructure table from Acquia's website: https://docs.acquia.com/cloud/arch/tech-platform.

By leveraging Docker technologies, Docker4Acquia provides an easy way of spinning up new environments along with its dependencies. This image can speed up a developer's onboarding time, despite his/her backgrounds and equipments, and quickly create a new local environment allowing them to easily integrate in automated tests and deployment pipelines.

Per design this solution will treat each Docker4Acquia instance/copy running as a Acquia subscription, what does it mean?

It means that it's capable of running multiple environments at the same time and each one of them are isolated one from another.


  • Docker Engine => 1.12
  • Docker Compose => 1.8.0
  • Mysql Client >=5.5
  • Netcat (nc)
  • Lynx
  • make

Note for Windows users: On Windows environments it is also required to install Linux Bash for Windows, more information about it can be found here and here.


At this moment this solution already contains the following Docker images:

Docker-Compose Docker Hub Image Port
cache ciandt/memcached 11211
database ciandt/percona 3306
search ciandt/solr 8983
web ciandt/php 80/443

*For specific software, OS, modules and libraries versions, please visit the refered Docker Image page


GitHub repo will have the following pattern;

YYYY-MM-DD

And also it is always available the latest version though this link.


First of all, download the code from Acquia subscription GIT repository.

We recommend to adopt the path /home/your-user/workspace as your workspace. Then, open a terminal go to the root of your subscription code, probably it is /home/your-user/workspace/your-subscription, and add Docker4Acquia as a GIT submodule with the command:

git submodule add https://github.com/ciandt-dev/docker4acquia

Simply start Docker4Acquia with default parameters:

cd docker4acquia
make linux # Change to mac OR windows according to your OS

You are ready to go, just follow the instructions on the screen.


There are two options to customize Docker4Acquia to better suit your project needs.

First one is to fork Docker4Acquia. This is very usefull when you can have your code avaiable publicly on Github. And the second one, is to donwload a release of Docker4Acquia and commit the modified code in your Acquia subscription GIT repository directly.

Lets explore these two options in detail.

Before starting any change, fork the project. In order to achieve it, please read Github official documentation about this topic here.

Then, download the code from your Acquia subscription GIT repository.

We recommend to adopt the path /home/your-user/workspace as your workspace. Then, open a terminal go to the root of your subscription code, probably it is /home/your-user/workspace/your-subscription, and add your Docker4Acquia fork as a GIT submodule with the command:

git submodule add https://github.com/my-Org/my-Fork-Repo

Change anything you may need and remember to commit.

Then, simply start Docker4Acquia with custom parameters:

cd docker4acquia
make linux # Change to mac OR windows according to your OS

You are ready to go, just follow the instructions on the screen

By any reason that your project may require to keep the code private, you can download the latest release of Docker4Acquia in releases page and customize it. For obvious reasons, we always recommend to use the newest version.

Start by downloading the code from your Acquia subscription GIT repository. We recommend to adopt the path /home/your-user/workspace as your workspace.

After, simply download the latest Docke4Acquia release, decompress in the root of your Git repo and change anything your project need.

Then, just run Docker4Acquia

cd docker4acquia
make linux # Change to mac OR windows according to your OS

You are ready to go, just follow the instructions on the screen


Hence your project is already hosted on Acquia platform there is no need to commit Docker4Acquia files other than dev branch.

Nevertheless, remember to include Docker4Acquia folder in your .gitignore file in stage and master (production) branches.


There is an .env file in the root of Docker4Acquia that can help tune Docker4Acquia in your project.

This file has several entries, better explained as follows.


Every Docker Image in this project is prepared to be customized to better fit any project requirements.

Let's suppose that your project needs a custom version of Memcached image for example.

First of all, open the file infrastructure/docker-compose.yaml, uncomment the build line and comment the image line.

From this:

#build: ./custom/memcached
image: ciandt/memcached:acquia-latest

To this:

build: ./custom/memcached
#image: ciandt/memcached:acquia-latest

After changing the docker-compose.yaml file just change the infrastructure/custom/memcached/Dockerfile to customize your Memcached with everything that your project may need.

To check if your Docker Image is building appropriately, simply run:

make build

If the build has run properly you are ready to go and use your own custom Docker Image.

If your project already have a public Docker Hub image and you want to use instead of the default Docker4Acquia one, just simply open the infrastructure/docker-compose.yaml and change to your own.

Let's suppose that you are changing Solr image.

From this:

image: ciandt/solr:acquia-latest

To this:

image: my-Docker-Hub-repo/my-Image:latest

Then you can use the bundled make commands to run and test with your Docker Image.


It is possible to perform any of the actions described below:

Build Docker images

make build

Build Docker images and run Docker Containers based on built Docker images

make run

Perform some tests on runnning Docker containers (requires run first)

make test

Build Docker images, run Docker Containers based on built Docker images and attaches output to current shell

make debug

Build Docker images, run Docker Containers based on built Docker images and attaches to PHP container bash

make shell

Stop running Docker containers, remove the containers and Docker network

make clean

Stop running Docker containers, remove the containers, delete Docker images and Docker network

make clean-all

Build Docker images, run Docker Containers based on built Docker images and perform tests

make all

or simply

make

Creates a Nginx proxy that exposes the HTTP and HTTPS port and redirects to Docker4Acquia containers, it is used for MacOS and Windows compatibity hence they work differently of Linux. More information about the proxy can be found here.

make proxy

Same as make all

make linux

Same as build, run and proxy

make mac

Same as build, run and proxy

make windows

If you have problems, bugs, issues with or questions about this, please reach us in Github issues page.

Needless to say, please do a little research before posting.

We gladly invite you to contribute fixes, new features, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.


Happy coding, enjoy!!

"We develop people before we develop software" - Cesar Gon, CEO

About

A project that mimics Acquia Drupal environment into Docker containers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 93.9%
  • Makefile 6.1%