1
0
mirror of https://github.com/tiyn/wiki.git synced 2025-04-19 22:17:45 +02:00
wiki/wiki/docker-images/portainer_-_agent.md

44 lines
1.4 KiB
Markdown

# portainer - agent
This is a [Docker](/wiki/docker.md) container for a [portainer](../portainer.md)
agent.
The official container and documentation was made by
[portainer](https://hub.docker.com/r/portainer/agent).
## Set-up
Create the file `rebuild.sh`.
Change the settings according to your needs and run `./rebuild.sh` afterwards.
## Volumes
Set the following volumes with the -v tag.
| Outside mount/volume name | Container mount | Description |
| ------------------------- | ------------------------- | -------------------------------------- |
| `/var/run/docker.sock` | `/var/run/docker.sock` | connect your running docker containers |
| `/var/lib/docker/volumes` | `/var/lib/docker/volumes` | connect running docker volumes |
## Ports
Set the following ports with the -p tag.
| Container Port | Recommended outside port | Protocol | Description |
| -------------- | ------------------------ | -------- | -------------------- |
| `9001` | `9001` | TCP | Portainer agent port |
## rebuild.sh
```sh
#!/bin/sh
docker stop portainer_agent
docker rm portainer_agent
docker pull portainer/agent:latest
docker run --name portainer_agent \
-p 9001:9001 \
--restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/docker/volumes:/var/lib/docker/volumes \
-d portainer/agent:latest
```