To install a custom package or modify an existing docker image we need to
- run a docker a container from the image we wish to modify
- modify the docker container
- commit the changes to the container as a docker image
- test changes made to image
| // remove utf-8 BOM from ressource "res" | |
| // res.charCodeAt(0) === 0xFEFF | res.charCodeAt(0) === 65279 | |
| if (res.charCodeAt(0) === 0xFEFF) { | |
| res = res.substr(1); | |
| } | 
| #----------------------------------------------------------------------- | |
| # To create the docker image : | |
| # cd <this file directory> | |
| # docker build -t apache-php-dev . | |
| # | |
| # Start image : | |
| # docker run -d -p 80:80 \ | |
| # -v /home/user/html:/var/www/html \ | |
| # -v /home/user/subdomain1:/var/www/subdomain1 \ | |
| # -v /home/user/subdomain2:/var/www/subdomain2 \ | 
| # sync everything excluding things in .gitignore | |
| # delete anything on target not in source | |
| # include dotfiles and symlinks, also use compression | |
| rsync -azP --delete --filter=":- .gitignore" . my-target-host:/my/target/directory | 
To install a custom package or modify an existing docker image we need to
| FROM php:5.6-apache | |
| RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql | |
| COPY src/ /var/www/html | 
Typing vagrant from the command line will display a list of all available commands.
Be sure that you are in the same directory as the Vagrantfile when running these commands!
vagrant init           -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)| <snippet> | |
| <content><![CDATA[ | |
| __$1__$2 | |
| ]]></content> | |
| <tabTrigger>__</tabTrigger> | |
| <scope>text.html.markdown</scope> | |
| </snippet> | 
| <?php | |
| require_once dirname(__FILE__) . '/../lib/simpletest/autorun.php'; | |
| function retry($f, $delay = 10, $retries = 3) | |
| { | |
| try { | |
| return $f(); | |
| } catch (Exception $e) { | |
| if ($retries > 0) { | |
| sleep($delay); | 
| # Option defaults | |
| OPT="value" | |
| # getopts string | |
| # This string needs to be updated with the single character options (e.g. -f) | |
| opts="fvo:" | |
| # Gets the command name without path | |
| cmd(){ echo `basename $0`; } |