change from rich format to markdown
parent
138276d7f1
commit
40b211be28
|
@ -14,41 +14,30 @@ encrypted password first.
|
|||
|
||||
You can generate the encrypted password with the following command:
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
$ htpasswd -nb -B admin <password> | cut -d ":" -f 2
|
||||
```
|
||||
<pre><code>$ htpasswd -nb -B admin <password> | cut -d ":" -f 2</code></pre>
|
||||
|
||||
or if your system does not provide htpasswd you can use a docker
|
||||
container with the command:
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
$ docker run --rm httpd:2.4-alpine htpasswd -nbB admin <password> | cut -d ":" -f 2
|
||||
```
|
||||
<pre><code>$ docker run --rm httpd:2.4-alpine htpasswd -nbB admin "password" | cut -d ":" -f 2</code></pre>
|
||||
|
||||
To specify the admin password from the command line, start Portainer
|
||||
with the `--admin-password` flag:
|
||||
To specify the admin password from the command line, start Portainer with the <code>--admin-password</code> flag:
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
$ docker run -d -p 9000:9000 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer --admin-password='$2y$05$qFHAlNAH0A.6oCDe1/4W.ueCWC/iTfBMXIHBI97QYfMWlMCJ7N.a6'
|
||||
```
|
||||
<pre><code>$ docker run -d -p 9000:9000 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer --admin-password='$2y$05$qFHAlNAH0A.6oCDe1/4W.ueCWC/iTfBMXIHBI97QYfMWlMCJ7N.a6'</code></pre>
|
||||
|
||||
### `Inside a file`
|
||||
|
||||
You can also store the plaintext password inside a file and use the
|
||||
`--admin-password-file` flag:
|
||||
You can also store the plaintext password inside a file and use the <code>--admin-password-file</code> flag:
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
# mypassword is plaintext here
|
||||
$ echo -n mypassword > /tmp/portainer_password
|
||||
$ docker run -d -p 9000:9000 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/portainer_password:/tmp/portainer_password portainer/portainer --admin-password-file /tmp/portainer_password
|
||||
```
|
||||
<pre><code>$ echo -n mypassword > /tmp/portainer_password</code></pre>
|
||||
|
||||
<pre><code>$ docker run -d -p 9000:9000 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/portainer_password:/tmp/portainer_password portainer/portainer --admin-password-file /tmp/portainer_password</code></pre>
|
||||
|
||||
This works well with Swarm & Docker secrets too:
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
# mypassword is plaintext here
|
||||
$ echo -n mypassword | docker secret create portainer-pass -
|
||||
$ docker service create \
|
||||
<pre><code>$ echo -n mypassword | docker secret create portainer-pass -</code></pre>
|
||||
|
||||
<pre><code>$ docker service create \
|
||||
--name portainer \
|
||||
--secret portainer-pass \
|
||||
--publish 9000:9000 \
|
||||
|
@ -58,38 +47,35 @@ $ docker service create \
|
|||
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
|
||||
portainer/portainer \
|
||||
--admin-password-file '/run/secrets/portainer-pass' \
|
||||
-H unix:///var/run/docker.sock
|
||||
```
|
||||
-H unix:///var/run/docker.sock</code></pre>
|
||||
|
||||
**Note**: This will automatically create an administrator account called
|
||||
**admin** with the specified password.
|
||||
<b>Note</b>: This will automatically create an administrator account called **admin** with the specified password.
|
||||
|
||||
Hiding specific containers
|
||||
--------------------------
|
||||
|
||||
Portainer allows you to hide containers with a specific label by using
|
||||
the `-l` flag.
|
||||
Portainer allows you to hide containers with a specific label by using the <code>-l</code> flag.
|
||||
|
||||
For example, take a container started with the label *owner=acme* (note
|
||||
that this is an example label, you can define your own labels):
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
<pre><code>
|
||||
$ docker run -d --label owner=acme nginx
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
To hide this container, simply add the `-l owner=acme` option on the CLI
|
||||
when starting Portainer:
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
<pre><code>
|
||||
$ docker run -d -p 9000:9000 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer -l owner=acme
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
Note that the `-l` flag can be repeated multiple times to specify
|
||||
multiple labels:
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
<pre><code>
|
||||
$ docker run -d -p 9000:9000 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer -l owner=acme -l service=secret
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
Use your own logo
|
||||
-----------------
|
||||
|
@ -98,9 +84,9 @@ You do not like our logo? Want to make Portainer more corporate? Don't
|
|||
worry, you can easily switch for an external logo (it must be exactly
|
||||
155px by 55px) using the `--logo` flag:
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
<pre><code>
|
||||
$ docker run -d -p 9000:9000 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer --logo "https://www.docker.com/sites/all/themes/docker/assets/images/brand-full.svg"
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
Use your own templates
|
||||
----------------------
|
||||
|
@ -126,25 +112,25 @@ template file on the file-system. By default, it points to
|
|||
|
||||
For example, you can mount your own template file inside the container:
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
<pre><code>
|
||||
$ docker run -d -p 9000:9000 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/my/templates.json:/templates.json portainer/portainer
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
Or using the --template-file to specify a specific path to the templates
|
||||
file:
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
<pre><code>
|
||||
$ docker run -d -p 9000:9000 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/template/folder:/templates portainer/portainer --template-file /templates/templates.json
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### Host your template file
|
||||
|
||||
Using the --templates flag you can specify an URL where the template
|
||||
file can be accessed via HTTP.
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
<pre><code>
|
||||
$ docker run -d -p 9000:9000 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer --templates http://my-host.my-domain/templates.json
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
For more information about hosting your own template definitions see
|
||||
Templates \<templates\>
|
||||
|
@ -161,9 +147,9 @@ and specify the path to the JSON file in the container.
|
|||
Note: when using the external endpoint management, endpoint management
|
||||
will be disabled in the UI.
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
<pre><code>
|
||||
$ docker run -d -p 9000:9000 -p 8000:8000 -v /tmp/endpoints:/endpoints portainer/portainer --external-endpoints /endpoints/endpoints.json
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
For more information about the endpoint definition format see
|
||||
External endpoints \<external\_endpoints\>
|
||||
|
|
|
@ -174,7 +174,7 @@ Portainer.
|
|||
|
||||
Here is an example compose file:
|
||||
|
||||
``` {.sourceCode .yaml}
|
||||
<pre><code>
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
|
@ -191,7 +191,7 @@ services:
|
|||
|
||||
volumes:
|
||||
portainer_data:
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
[Click here](https://downloads.portainer.io/docker-compose.yml) to
|
||||
download the Compose file.
|
||||
|
|
|
@ -6,7 +6,7 @@ External endpoint definitions are written in JSON.
|
|||
It must consist of an array with every endpoint definition consisting of
|
||||
one element.
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
[
|
||||
{
|
||||
"Name": "my-first-endpoint",
|
||||
|
@ -22,7 +22,7 @@ one element.
|
|||
"TLSKey": "/tmp/key.pem"
|
||||
}
|
||||
]
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
Endpoint definition format
|
||||
--------------------------
|
||||
|
@ -31,7 +31,7 @@ An endpoint element must be a valid [JSON](http://www.json.org/) object.
|
|||
|
||||
Example:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"Name": "my-secure-endpoint",
|
||||
"URL": "tcp://myendpoint.mydomain:2375",
|
||||
|
@ -40,7 +40,7 @@ Example:
|
|||
"TLSCert": "/tmp/cert.pem",
|
||||
"TLSKey": "/tmp/key.pem"
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
It is composed of multiple fields, some mandatory and some optionals.
|
||||
|
||||
|
@ -118,4 +118,4 @@ When using external endpoint management, endpoint management will via
|
|||
the UI will be disabled to avoid any possible configuration overwrite
|
||||
(the endpoints view is still accessible but will only display the list
|
||||
of endpoints without giving the possibility to create/update endpoints).
|
||||
A simple warning message will be displayed in the endpoints view.
|
||||
A simple warning message will be displayed in the endpoints view.
|
|
@ -13,7 +13,7 @@ A template element must be a valid [JSON](http://www.json.org/) object.
|
|||
|
||||
Example of a container template:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"type": 1,
|
||||
"title": "Nginx",
|
||||
|
@ -25,7 +25,7 @@ Example of a container template:
|
|||
"443/tcp"
|
||||
]
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
It is composed of multiple fields, some mandatory and some optionals.
|
||||
|
||||
|
@ -66,11 +66,11 @@ This field is **optional**.
|
|||
|
||||
Example:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"administrator_only": true
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `name`
|
||||
|
||||
|
@ -100,11 +100,11 @@ This field is **optional**.
|
|||
|
||||
Example:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"command": "/bin/bash -c \"echo hello\" && exit 777"
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `env`
|
||||
|
||||
|
@ -119,7 +119,7 @@ This field is **optional**.
|
|||
|
||||
Element format:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"name": "the name of the environment variable, as supported in the container image (mandatory)",
|
||||
"label": "label for the input in the UI (mandatory unless set is present)",
|
||||
|
@ -128,11 +128,11 @@ Element format:
|
|||
"preset": "boolean. If set to true, the UI will not generate an input (optional)",
|
||||
"select": "an array of possible values, will generate a select input (optional)"
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
Example:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"env": [
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ Example:
|
|||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `network`
|
||||
|
||||
|
@ -180,11 +180,11 @@ This field is **optional**.
|
|||
|
||||
Example:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"network": "host"
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `volumes`
|
||||
|
||||
|
@ -201,7 +201,7 @@ This field is **optional**.
|
|||
|
||||
Example:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"volumes": [
|
||||
{
|
||||
|
@ -214,7 +214,7 @@ Example:
|
|||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `ports`
|
||||
|
||||
|
@ -232,11 +232,11 @@ This field is **optional**.
|
|||
|
||||
Example:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"ports": ["8080:80/tcp", "443/tcp"]
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `labels`
|
||||
|
||||
|
@ -248,7 +248,7 @@ This field is **optional**.
|
|||
|
||||
Example:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"labels": [
|
||||
{ "name": "com.example.vendor", "value": "Acme" },
|
||||
|
@ -256,7 +256,7 @@ Example:
|
|||
{ "name": "com.example.version", "value": "1.0" }
|
||||
]
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `privileged`
|
||||
|
||||
|
@ -265,11 +265,11 @@ default to false if not specified.
|
|||
|
||||
This field is **optional**.
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"privileged": true
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `interactive`
|
||||
|
||||
|
@ -278,11 +278,11 @@ flags). Boolean, will default to false if not specified.
|
|||
|
||||
This field is **optional**.
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"interactive": true
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `restart_policy`
|
||||
|
||||
|
@ -296,11 +296,11 @@ following:
|
|||
|
||||
This field is **optional**. Will default to `always` if not specified.
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"restart_policy": "unless-stopped"
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `hostname`
|
||||
|
||||
|
@ -308,11 +308,11 @@ Set the hostname of the container.
|
|||
|
||||
This field is **optional**. Will use Docker default if not specified.
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"hostname": "mycontainername"
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `note`
|
||||
|
||||
|
@ -323,11 +323,11 @@ Supports HTML.
|
|||
|
||||
This field is **optional**.
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"note": "You can use this field to specify extra information. <br/> It supports <b>HTML</b>."
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `platform`
|
||||
|
||||
|
@ -337,11 +337,11 @@ Portainer UI.
|
|||
|
||||
This field is **optional**.
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"platform": "linux"
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `categories`
|
||||
|
||||
|
@ -351,11 +351,11 @@ categories.
|
|||
|
||||
This field is **optional**.
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"categories": ["webserver", "open-source"]
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
Stack template definition format
|
||||
--------------------------------
|
||||
|
@ -364,7 +364,7 @@ A template element must be a valid [JSON](http://www.json.org/) object.
|
|||
|
||||
Example of a stack template:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"type": 2,
|
||||
"title": "CockroachDB",
|
||||
|
@ -378,7 +378,7 @@ Example of a stack template:
|
|||
"stackfile": "stacks/cockroachdb/docker-stack.yml"
|
||||
}
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
It is composed of multiple fields, some mandatory and some optionals.
|
||||
|
||||
|
@ -416,21 +416,21 @@ well as the path to the Compose file inside the repository.
|
|||
|
||||
Element format:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"url": "URL of the public git repository (mandatory)",
|
||||
"stackfile": "Path to the Compose file inside the repository (mandatory)",
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
Example:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"url": "https://github.com/portainer/templates",
|
||||
"stackfile": "stacks/cockroachdb/docker-stack.yml"
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
This field is **mandatory**.
|
||||
|
||||
|
@ -442,11 +442,11 @@ This field is **optional**.
|
|||
|
||||
Example:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"administrator_only": true
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `name`
|
||||
|
||||
|
@ -473,7 +473,7 @@ This field is **optional**.
|
|||
|
||||
Element format:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"name": "the name of the environment variable, as supported in the container image (mandatory)",
|
||||
"label": "label for the input in the UI (mandatory unless set is present)",
|
||||
|
@ -482,11 +482,11 @@ Element format:
|
|||
"preset": "boolean. If set to true, the UI will not generate an input (optional)",
|
||||
"select": "an array of possible values, will generate a select input (optional)"
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
Example:
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"env": [
|
||||
{
|
||||
|
@ -522,7 +522,7 @@ Example:
|
|||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `note`
|
||||
|
||||
|
@ -533,11 +533,11 @@ Supports HTML.
|
|||
|
||||
This field is **optional**.
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"note": "You can use this field to specify extra information. <br/> It supports <b>HTML</b>."
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `platform`
|
||||
|
||||
|
@ -547,11 +547,11 @@ Portainer UI.
|
|||
|
||||
This field is **optional**.
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"platform": "linux"
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
### `categories`
|
||||
|
||||
|
@ -561,11 +561,11 @@ categories.
|
|||
|
||||
This field is **optional**.
|
||||
|
||||
``` {.sourceCode .json}
|
||||
<pre><code>
|
||||
{
|
||||
"categories": ["webserver", "open-source"]
|
||||
}
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
Build and host your own templates
|
||||
---------------------------------
|
||||
|
@ -582,13 +582,13 @@ Clone the [Portainer templates
|
|||
repository](https://github.com/portainer/templates), edit the templates
|
||||
file, build and run the container:
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
</code></pre> {.sourceCode .bash}
|
||||
$ git clone https://github.com/portainer/templates.git portainer-templates
|
||||
$ cd portainer-templates
|
||||
# Edit the file templates.json
|
||||
$ docker build -t portainer-templates .
|
||||
$ docker run -d -p "8080:80" portainer-templates
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
Now you can access your templates definitions at
|
||||
`http://docker-host:8080/templates.json`.
|
||||
|
@ -596,6 +596,6 @@ Now you can access your templates definitions at
|
|||
You can also mount the `templates.json` file inside the container, so
|
||||
you can edit the file and see live changes:
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
</code></pre> {.sourceCode .bash}
|
||||
$ docker run -d -p "8080:80" -v "${PWD}/templates.json:/usr/share/nginx/html/templates.json" portainer-templates
|
||||
```
|
||||
</code></pre>
|
||||
|
|
|
@ -16,7 +16,7 @@ correctly on your system.
|
|||
The above command should have returned information about Docker running
|
||||
on your system. Below is a snippet of what this may look like.
|
||||
|
||||
``` {.sourceCode .bash}
|
||||
<pre><code>
|
||||
$ Client: Docker Engine - Community
|
||||
Version: 19.03.3
|
||||
API version: 1.40
|
||||
|
@ -25,7 +25,7 @@ $ Client: Docker Engine - Community
|
|||
Built: Tue Oct 8 00:59:59 2019
|
||||
OS/Arch: linux/amd64
|
||||
Experimental: false
|
||||
```
|
||||
</code></pre>
|
||||
|
||||
Ensuring Docker Swarm is configured correctly
|
||||
---------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue