diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8ef15bb22..c6e66f66d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,7 +75,7 @@ The feature request process is similar to the bug report process but has an extr ![portainer_featurerequest_workflow](https://user-images.githubusercontent.com/5485061/45727229-5ad39f00-bbf5-11e8-9550-16ba66c50615.png) -## Build Portainer locally +## Build and run Portainer locally Ensure you have Docker, Node.js, yarn, and Golang installed in the correct versions. @@ -85,7 +85,7 @@ Install dependencies with yarn: $ yarn ``` -Then build and run the project: +Then build and run the project in a Docker container: ```sh $ yarn start @@ -95,6 +95,14 @@ Portainer can now be accessed at . Find more detailed steps at . +### Build customisation + +You can customise the following settings: + +- `PORTAINER_DATA`: The host dir or volume name used by portainer (default is `/tmp/portainer`, which won't persist over reboots). +- `PORTAINER_PROJECT`: The root dir of the repository - `${portainerRoot}/dist/` is imported into the container to get the build artifacts and external tools (defaults to `your current dir`). +- `PORTAINER_FLAGS`: a list of flags to be used on the portainer commandline, in the form `--admin-password= --feat fdo=false --feat open-amt` (default: `""`). + ## Adding api docs When adding a new resource (or a route handler), we should add a new tag to api/http/handler/handler.go#L136 like this: diff --git a/gruntfile.js b/gruntfile.js index 9995b0350..1d5bef6af 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -158,6 +158,7 @@ function shell_build_binary_azuredevops(platform, arch) { function shell_run_container() { const portainerData = '${PORTAINER_DATA:-/tmp/portainer}'; const portainerRoot = process.env.PORTAINER_PROJECT ? process.env.PORTAINER_PROJECT : process.env.PWD; + const portainerFlags = '${PORTAINER_FLAGS:-}'; return ` docker rm -f portainer @@ -172,7 +173,7 @@ function shell_run_container() { -v /tmp:/tmp \ --name portainer \ portainer/base \ - /app/portainer + /app/portainer ${portainerFlags} `; }