You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add automatic hub updates section to Docker installation guide
- Add comprehensive cron job setup for Docker run and Docker Compose deployments
- Include scripts that handle hub updates and container restarts
- Use modern Docker Compose V2 syntax (docker compose instead of docker-compose)
- Add full binary paths to handle cron environment limitations
- Provide unified script naming for easier user experience
- Include setup instructions and troubleshooting tips
Copy file name to clipboardExpand all lines: crowdsec-docs/unversioned/getting_started/installation/docker.mdx
+97Lines changed: 97 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,6 +129,103 @@ Here are the most common environment variables for customizing CrowdSec in Docke
129
129
Use a `.env` file or Docker secrets to avoid hardcoding sensitive variables like passwords or API keys.
130
130
:::
131
131
132
+
## Automatic Hub Updates
133
+
134
+
To keep your CrowdSec installation up to date with the latest parsers, scenarios, and collections from the hub, you can set up an automated cron job that will check for updates and restart the container when needed.
135
+
136
+
### Docker Run Setup
137
+
138
+
For containers started with `docker run`, create this script:
139
+
140
+
```bash
141
+
#!/bin/bash
142
+
# /usr/local/bin/crowdsec-update.sh
143
+
144
+
CONTAINER_NAME="crowdsec" # Adjust to your container name
145
+
DOCKER_BIN="/usr/bin/docker" # Adjust path if needed
146
+
147
+
# Check if container is running
148
+
if ! $DOCKER_BIN ps --format "table {{.Names}}" | grep -q "^${CONTAINER_NAME}$"; then
**Docker Compose is recommended** as it doesn't require knowing the exact container name and works with the service name from your `docker-compose.yml`.
0 commit comments