README.md 2.63 KB
Newer Older
1
2
Bocker-BaseImage
================
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
3

4
This repo contains a recipe for making a [Docker](http://docker.io) baseimage using Linux, Apache, MySQL, git, drush, and more. 
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
5
6
To build, make sure you have Docker [installed](http://www.docker.io/gettingstarted/).

7
8
This image is used in other projects like [Drupal sfl-boilerplate](https://gitlab.savoirfairelinux.com/drupal/sfl-boilerplate) and the purpouse is to provide to others Drupal projects a baseimage with all dependency installed to make tests and install Drupal.

Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
9
## Install docker:
10
11
12
13

Log into your Ubuntu installation as a user with sudo privileges.

Verify that you have wget installed.
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
14
```
15
$ which wget
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
16
```
17
If wget isn't installed, install it after updating your manager:
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
18
```
19
$ sudo apt-get update $ sudo apt-get install wget
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
20
```
21
Get the latest Docker package.
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
22
```
23
$ wget -qO- https://get.docker.com/ | sh
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
24
```
25
The system prompts you for your sudo password. Then, it downloads and installs Docker and its dependencies.
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
26

27
28
29
30
31
Verify docker is installed correctly.
```
$ sudo docker version
```
This command should show you the version of docker installed in your system
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
32

33
Add your user to the docker group to be able to execute docker command wihtout sudo
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
34
```
35
$ adduser <user> docker
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
36
```
37
38
39
Remember logout and login to the last command take effect.

#### To install docker in other OS look [here](https://docs.docker.com/installation)
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
40

Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
41
## Clone this repo somewhere, 
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
42
```
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
43
44
$ git clone https://gitlab.savoirfairelinux.com/drupal/docker-lampd.git
$ cd docker-lampd
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
45
```
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
46
and then build it:
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
47
```
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
48
$ docker build -t sflinux/baseimage .
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
49
50
```

Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
51
this can take a while but should eventually return a command prompt. It's done when it says "Successfully built {hash}"
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
52

Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
53
54
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
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
55

Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
56
You can verifid this runing
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
57
58

```
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
59
$ docker images
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
60
61
REPOSITORY              TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
sflinux/baseimage       latest              a57eacb74c44        4 days ago          723.7 MB
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
62
63
```

Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
64
### More information about this project
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
65

Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
66
This project use phusion/baseimage like base image to build and image with all the software neede to install Drupal projects and make tests
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
67

Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
68
To read about why use phusion/baseimage and not ubuntu:14.04 look at [Phusion Baseimage](https://registry.hub.docker.com/u/phusion/baseimage/).
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
69

Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
70
You generally not will need to run this image, it will be used generally to build other images
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
71
72
73
74
75
76
77
78


## Contributing
Feel free to fork and contribute to this code. :)


## Authors

79
Created and maintained by [Ernesto Rodriguez Ortiz](ernesto.rodriguezortiz@savoirfairelinux.com>)
Ernesto Rodriguez Ortiz's avatar
Ernesto Rodriguez Ortiz committed
80
81

## License
82
GPL v2