2017-02-23 03:59:06 +08:00
---
title: Contributing
type: index
2017-04-14 16:43:26 +08:00
weight: 7
2017-02-23 03:59:06 +08:00
---
2017-04-23 02:07:50 +08:00
## Have a Question
2017-02-23 03:59:06 +08:00
2017-03-17 05:44:14 +08:00
If you have questions about how to use Laradock, please direct your questions to the discussion on [Gitter ](https://gitter.im/Laradock/laradock ). If you believe your question could help others, then consider opening an [Issue ](https://github.com/laradock/laradock/issues ) (it will be labeled as `Question` ) And you can still seek help on Gitter for it.
2017-02-23 03:59:06 +08:00
2017-04-23 02:07:50 +08:00
## Found an Issue
2017-10-25 15:32:12 +08:00
If you have an issue or you found a typo in the documentation, you can help us by
2017-10-12 09:08:24 +08:00
opening an [Issue ](https://github.com/laradock/laradock/issues ).
2017-02-23 03:59:06 +08:00
2017-03-17 05:44:14 +08:00
**Steps to do before opening an Issue:**
2017-02-23 03:59:06 +08:00
2017-03-17 05:44:14 +08:00
1. Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).
2017-02-23 03:59:06 +08:00
2017-03-17 05:44:14 +08:00
2. Decide if the Issue belongs to this project or to [Docker ](https://github.com/docker ) itself! or even the tool you are using such as Nginx or MongoDB...
If your issue appears to be a bug, and hasn't been reported, then open a new issue.
2017-10-12 09:08:24 +08:00
*This helps us maximize the effort we can spend fixing issues and adding new
2017-03-17 05:44:14 +08:00
features, by not reporting duplicate issues.*
2017-04-23 02:07:50 +08:00
## Want a Feature
You can request a new feature by submitting an [Issue ](https://github.com/laradock/laradock/issues ) (it will be labeled as `Feature Suggestion` ). If you would like to implement a new feature then consider submitting a Pull Request yourself.
2017-03-17 05:44:14 +08:00
2017-04-23 02:07:50 +08:00
## Update the Documentation (Site)
2017-02-23 05:17:15 +08:00
Laradock uses [Hugo ](https://gohugo.io/ ) as website generator tool, with the [Material Docs theme ](http://themes.gohugo.io/theme/material-docs/ ). You might need to check their docs quickly.
2017-04-15 02:43:28 +08:00
Go the `DOCUMENTATION/content` and search for the markdown file you want to edit
2017-02-23 05:17:15 +08:00
2017-04-15 02:37:31 +08:00
Note: Every folder represents a section in the sidebar "Menu". And every page and sidebar has a `weight` number to show it's position in the site.
2017-04-14 15:55:08 +08:00
2017-04-15 02:43:28 +08:00
To update the sidebar or add a new section to it, you can edit this `DOCUMENTATION/config.toml` toml file.
2017-04-15 02:37:31 +08:00
> The site will be auto-generated in the `docs/` folder by [Travis CI](https://travis-ci.org/laradock/laradock/).
2017-02-23 05:17:15 +08:00
2017-04-23 02:07:50 +08:00
### Host the documentation locally
2017-02-23 05:17:15 +08:00
2017-04-15 02:37:31 +08:00
1. Install [Hugo ](https://gohugo.io/ ) on your machine.
2017-04-15 02:43:28 +08:00
2. Edit the `DOCUMENTATION/content` .
2017-04-14 15:55:08 +08:00
3. Delete the `/docs` folder from the root.
2017-04-15 02:43:28 +08:00
4. After you finish the editing, go to `DOCUMENTATION/` and run the `hugo` command to generate the HTML docs (inside a new `/docs` folder).
2017-02-23 05:17:15 +08:00
2017-02-23 03:59:06 +08:00
2017-04-23 02:07:50 +08:00
## Support new Software (Add new Container)
2017-02-23 03:59:06 +08:00
2017-10-12 09:08:24 +08:00
* Fork the repo and clone the code.
2017-02-23 03:59:06 +08:00
2017-04-23 02:07:50 +08:00
* Create folder as the software name (example: `mysql` - `nginx` ).
2017-02-23 03:59:06 +08:00
2017-04-23 02:07:50 +08:00
* Add your `Dockerfile` in the folder "you may add additional files as well".
2017-02-23 03:59:06 +08:00
* Add the software to the `docker-compose.yml` file.
2017-04-23 02:07:50 +08:00
* Make sure you follow the same code/comments style.
* Add the environment variables to the `env-example` if you have any.
* **MOST IMPORTANTLY** updated the `Documentation` , add as much information.
2017-02-23 03:59:06 +08:00
2017-04-23 02:07:50 +08:00
* Submit a Pull Request, to the `master` branch.
2017-02-23 03:59:06 +08:00
2017-04-23 02:07:50 +08:00
## Edit supported Software (Edit a Container)
2017-02-23 03:59:06 +08:00
2017-10-12 09:08:24 +08:00
* Fork the repo and clone the code.
2017-04-23 02:07:50 +08:00
* Open the software (container) folder (example: `mysql` - `nginx` ).
* Edit the files.
2017-02-23 03:59:06 +08:00
2017-03-17 05:44:14 +08:00
* Make sure to update the `Documentation` in case you made any changes.
2017-02-23 03:59:06 +08:00
2017-04-23 02:07:50 +08:00
* Submit a Pull Request, to the `master` branch.
## Edit Base Image
* Open any dockerfile, copy the base image name (example: `FROM phusion/baseimage:latest` ).
* Search for the image in the [Docker Hub ](https://hub.docker.com/search/ ) and find the source..
*Most of the image in Laradock are offical images, these projects live in other repositories and maintainer by other orgnizations.*
**Note:** Laradock has two base images for (`Workspace` and `php-fpm` , mainly made to speed up the build time on your machine.
* Find the dockerfiles, edit them and submit a Pull Request.
* When updating a Laradock base image (`Workspace` or `php-fpm` ), ask a project maintainer "Admin" to build a new image after your PR is merged.
**Note:** after the base image is updated, every dockerfile that uses that image, needs to update his base image tag to get the updated code.
< br >
2017-02-23 03:59:06 +08:00
2017-04-23 02:07:50 +08:00
## Submit Pull Request Instructions
2017-02-23 03:59:06 +08:00
2017-03-17 05:44:14 +08:00
### 1. Before Submitting a Pull Request (PR)
2017-02-23 03:59:06 +08:00
Always Test everything and make sure its working:
- Pull the latest updates (or fork of you don’ t have permission)
- Before editing anything:
- Test building the container (docker-compose build --no-cache container-name) build with no cache first.
- Test running the container with some other containers in real app and see of everything is working fine.
- Now edit the container (edit section by section and test rebuilding the container after every edited section)
- Testing building the container (docker-compose build container-name) with no errors.
2017-03-17 05:44:14 +08:00
- Test it in a real App if possible.
2017-02-23 03:59:06 +08:00
2017-03-17 05:44:14 +08:00
### 2. Submitting a PR
2017-02-23 03:59:06 +08:00
Consider the following guidelines:
2017-03-17 05:44:14 +08:00
* Search [GitHub ](https://github.com/laradock/laradock/pulls ) for an open or closed Pull Request that relates to your submission. You don't want to duplicate efforts.
2017-02-23 03:59:06 +08:00
* Make your changes in a new git branch:
```shell
git checkout -b my-fix-branch master
```
* Commit your changes using a descriptive commit message.
* Push your branch to GitHub:
```shell
git push origin my-fix-branch
```
* In GitHub, send a pull request to `laradock:master` .
* If we suggest changes then:
* Make the required updates.
* Commit your changes to your branch (e.g. `my-fix-branch` ).
* Push the changes to your GitHub repository (this will update your Pull Request).
> If the PR gets too outdated we may ask you to rebase and force push to update the PR:
```shell
git rebase master -i
git push origin my-fix-branch -f
```
*WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.*
2017-03-17 05:44:14 +08:00
### 3. After your PR is merged
2017-02-23 03:59:06 +08:00
2017-03-17 05:44:14 +08:00
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
2017-02-23 03:59:06 +08:00
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
```shell
git push origin --delete my-fix-branch
```
* Check out the master branch:
```shell
git checkout master -f
```
* Delete the local branch:
```shell
git branch -D my-fix-branch
```
* Update your master with the latest upstream version:
```shell
git pull --ff upstream master
```
< br >
2017-03-17 05:44:14 +08:00
#### Happy Coding :)