Commit 8d3443a8 authored by Ernesto Rodriguez Ortiz's avatar Ernesto Rodriguez Ortiz
Browse files

Update the README

parent 2610a6cf
......@@ -6,112 +6,72 @@ To build, make sure you have Docker [installed](http://www.docker.io/gettingstar
This will try to go in line with [Drupal automated-testing](https://drupal.org/automated-testing).
## kill any running docker daemon
```
sudo killall docker
```
## Install docker:
First, check that your APT system can deal with https URLs: the file /usr/lib/apt/methods/https should exist. If it doesn't, you need to install the package apt-transport-https.
```
curl get.docker.io | sudo sh -x
[ -e /usr/lib/apt/methods/https ] || {
apt-get update
apt-get install apt-transport-https
}
```
## Clone this repo somewhere,
Then, add the Docker repository key to your local keychain.
```
git clone https://github.com/ricardoamaro/docker-drupal.git
cd docker-drupal
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
```
and then build it:
Add the Docker repository to your apt sources list, update and install the lxc-docker package.
```
sudo docker build -t <yourname>/drupal .
sudo sh -c "echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get install lxc-docker
```
this can take a while but should eventually return a command prompt. It's done when it says "Successfully built {hash}"
Add your user to the docker group to be able to execute docker command wihtout sudo
## And run the container, connecting port 80:
```
sudo docker run -d -t -p 80:80 <yourname>/drupal
adduser <user> docker
```
That's it!
Visit http://localhost/ in your webrowser.
Note: you cannot have port 80 already used or the container will not start.
In that case you can start by setting: `-p 8080:80`
build directly from github is broken at the moment:
## Clone this repo somewhere,
```
sudo docker build -t <yourname>/drupal git://github.com/ricardoamaro/docker-drupal.git
git clone https://gitlab.savoirfairelinux.com/erortiz/docker-lampd.git
cd docker-lampd
```
### Credentials
* ROOT MYSQL_PASSWORD will be on /mysql-root-pw.txt
* DRUPAL MYSQL PASSWORD will be on /drupal-db-pw.txt
* Drupal account-name=admin & account-pass=admin
## More docker awesomeness
This will create an ID that you can start/stop/commit changes:
and then build it:
```
# sudo docker ps
ID IMAGE COMMAND CREATED STATUS PORTS
538114c20d36 <yourname>/drupal:latest /bin/bash /start.sh 3 minutes ago Up 6 seconds 80->80
sudo docker build -t sflinux/baseimage .
```
Start/Stop
```
sudo docker stop 538114c20d36
sudo docker start 538114c20d36
```
this can take a while but should eventually return a command prompt. It's done when it says "Successfully built {hash}"
Commit the actual state to the image
```
sudo docker commit 538114c20d36 <yourname>/drupal
```
That's it!
Now you have your base image that can be used in all your Drupal projects instead of use ubuntu:lastes or ubuntu:14.04
Starting again with the commited changes
```
sudo docker run -d -t -p 80:80 <yourname>/drupal /start.sh
```
You can verifid this runing
Shipping the container image elsewhere
```
sudo docker push <yourname>/drupal
# sudo docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
sflinux/baseimage latest a57eacb74c44 4 days ago 723.7 MB
```
You can find more images using the [Docker Index][docker_index].
### More information about this project
ricardoamaro/drupal-lamp
This project use phusion/baseimage like base image to build and image with all the software neede to install Drupal projects and make tests
### Clean up
While i am developing i use this to rm all old instances
```
sudo docker ps -a | awk '{print $1}' | grep -v CONTAINER | xargs -n1 -I {} docker rm {}
```
To read about why use phusion/baseimage and not ubuntu:14.04 look at [Phusion Baseimage](https://registry.hub.docker.com/u/phusion/baseimage/).
### Known Issues
* Upstart on Docker is broken due to [this issue][docker_upstart_issue], and that's one of the reasons the image is puppetized using vagrant.
* Warning: This is still in development and ports shouldn't be open to the outside world.
You generally not will need to run this image, it will be used generally to build other images
## Contributing
Feel free to fork and contribute to this code. :)
1. Fork the repo
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
## Authors
Created and maintained by [Ricardo Amaro][author] (<mail_at_ricardoamaro.com>)
Created and maintained by [Ernesto Rodriguez Ortiz][author] (ernesto.rodriguezortiz@savoirfairelinux.com>)
## License
GPL v3
[author]: https://github.com/ricardoamaro
[docker_upstart_issue]: https://github.com/dotcloud/docker/issues/223
[docker_index]: https://index.docker.io/
GPL v2
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment