Skip to content

Commit f610497

Browse files
authored
Merge pull request #787 from Paraphraser/20250305-chronograf-master
2025-03-05 Chronograf - master branch - PR 1 of 2
2 parents 15308de + b842ff6 commit f610497

File tree

4 files changed

+80
-2
lines changed

4 files changed

+80
-2
lines changed

.templates/chronograf/Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM chronograf:alpine
2+
3+
# see https://github.com/influxdata/influxdata-docker/pull/781
4+
# this patch can be withdrawn if/when PR781 is applied.
5+
6+
COPY entrypoint.sh /entrypoint.sh
7+
8+
# EOF

.templates/chronograf/entrypoint.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [ "${1:0:1}" = '-' ]; then
5+
set -- chronograf "$@"
6+
fi
7+
8+
if [ "$1" = 'chronograf' ]; then
9+
export BOLT_PATH=${BOLT_PATH:-/var/lib/chronograf/chronograf-v1.db}
10+
fi
11+
12+
if [ $(id -u) -eq 0 ] ; then
13+
if [ "${CHRONOGRAF_AS_ROOT}" != "true" ] ; then
14+
chown -Rc chronograf:chronograf /var/lib/chronograf
15+
exec su-exec chronograf "$@"
16+
fi
17+
chown -Rc root:root /var/lib/chronograf
18+
else
19+
if [ ! -w /var/lib/chronograf ] ; then
20+
echo "You need to change ownership on chronograf's persistent store. Run:"
21+
echo " sudo chown -R $(id -u):$(id -u) /path/to/persistent/store"
22+
fi
23+
fi
24+
25+
exec "$@"

.templates/chronograf/service.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
chronograf:
22
container_name: chronograf
3-
image: chronograf:latest
3+
build:
4+
context: ./.templates/chronograf/.
45
restart: unless-stopped
56
environment:
67
- TZ=${TZ:-Etc/UTC}
@@ -10,11 +11,11 @@ chronograf:
1011
# - INFLUXDB_PASSWORD=
1112
# - INFLUXDB_ORG=
1213
# - KAPACITOR_URL=http://kapacitor:9092
14+
# - CHRONOGRAF_AS_ROOT=true
1315
ports:
1416
- "8888:8888"
1517
volumes:
1618
- ./volumes/chronograf:/var/lib/chronograf
1719
depends_on:
1820
- influxdb
1921
# - kapacitor
20-

docs/Containers/Chronograf.md

+44
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ In words:
4545
* `docker-compose up -d` causes any newly-downloaded images to be instantiated as containers (replacing the old containers); and
4646
* the `prune` gets rid of the outdated images.
4747

48+
See also [2025-03-04 patch](#patch1).
49+
4850
### Chronograf version pinning
4951

5052
If you need to pin to a particular version:
@@ -69,3 +71,45 @@ If you need to pin to a particular version:
6971
$ docker-compose up -d chronograf
7072
$ docker system prune
7173
```
74+
75+
<a name="patch1"></a>
76+
## 2025-03-04 patch
77+
78+
Chronograf does not start properly from a clean slate. The cause is explained [here](https://github.com/influxdata/influxdata-docker/pull/781).
79+
80+
You can solve the problem in two ways:
81+
82+
1. You can set the correct permissions yourself:
83+
84+
``` console
85+
$ cd ~/IOTstack
86+
$ docker-compose down chronograf
87+
$ sudo chown -R 999:999 ./volumes/chronograf
88+
$ docker-compose up -d chronograf
89+
```
90+
91+
Generally, this is a one-time fix. You will only need to repeat it if you start Chronograf from a clean slate.
92+
93+
2. You can adopt the updated service definition, either by:
94+
95+
- using the menu to delete then reinstall `chronograf`; or by
96+
- using a text editor to hand-merge the contents of:
97+
98+
```
99+
~/IOTstack/.templates/chronograf/service.yml
100+
```
101+
102+
with:
103+
104+
```
105+
~/IOTstack/docker-compose.yml
106+
```
107+
108+
If you adopt the updated service definition then the process for keeping Chronograf up-to-date becomes:
109+
110+
``` console
111+
$ cd ~/IOTstack
112+
$ docker-compose build --no-cache --pull chronograf
113+
$ docker-compose up -d chronograf
114+
$ docker system prune
115+
```

0 commit comments

Comments
 (0)