mirror of
https://github.com/11notes/docker-influxdb.git
synced 2025-11-02 04:53:27 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2270157b45 | ||
|
|
ebf3cbd504 | ||
|
|
245634ccc8 | ||
|
|
03b3cd2a1d | ||
|
|
b5fa136284 |
37
README.md
37
README.md
@@ -1,4 +1,6 @@
|
||||
# Alpine :: InfluxDB
|
||||
    
|
||||
|
||||
Run InfluxDB based on Alpine Linux. Small, lightweight, secure and fast 🏔️
|
||||
|
||||
## Volumes
|
||||
@@ -8,25 +10,50 @@ Run InfluxDB based on Alpine Linux. Small, lightweight, secure and fast 🏔️
|
||||
## Run
|
||||
```shell
|
||||
docker run --name influxdb \
|
||||
-p 8086:8086 \
|
||||
-v .../etc/config.yml:/influxdb/etc/config.yml \
|
||||
-v .../var:/influxdb/var \
|
||||
-d 11notes/influxdb:[tag]
|
||||
```
|
||||
|
||||
```shell
|
||||
docker run --name influxdb \
|
||||
-p 8086:8086 \
|
||||
-v .../etc/config.yml:/influxdb/etc/config.yml \
|
||||
-v .../var:/influxdb/var \
|
||||
-e DOCKER_INFLUXDB_INIT_MODE=setup \
|
||||
-e DOCKER_INFLUXDB_INIT_USERNAME=admin \
|
||||
-e DOCKER_INFLUXDB_INIT_PASSWORD=**************** \
|
||||
-e DOCKER_INFLUXDB_INIT_ORG=DOCKER \
|
||||
-e DOCKER_INFLUXDB_INIT_BUCKET=test \
|
||||
-e DOCKER_INFLUXDB_INIT_RETENTION=24h \
|
||||
-d 11notes/influxdb:[tag]
|
||||
```
|
||||
|
||||
## Defaults
|
||||
| Parameter | Value | Description |
|
||||
| --- | --- | --- |
|
||||
| `user` | docker | user docker |
|
||||
| `uid` | 1000 | user id 1000 |
|
||||
| `gid` | 1000 | group id 1000 |
|
||||
| `home` | /influxdb | home directory of user docker |
|
||||
| `web` | https://${IP}:8086 | default web ui |
|
||||
| `config` | /influxdb/etc/config.yml | default config location |
|
||||
| `ssl` | /influxdb/ssl | SSL is enabled by default |
|
||||
|
||||
## Parent
|
||||
* [influxdb:2.7-alpine](https://github.com/influxdata/influxdata-docker/tree/master/influxdb/2.7/alpine)
|
||||
## Access
|
||||
| Parameter | Value | Description |
|
||||
| --- | --- | --- |
|
||||
| `web` | https://${IP}:8086 | default web ui |
|
||||
|
||||
## Built with
|
||||
## Parent Image
|
||||
* [influxdb:2.7.3-alpine](https://github.com/influxdata/influxdata-docker/blob/d141bf4a31102263b69128166c5b22496cac0c64/influxdb/2.7/alpine/Dockerfile)
|
||||
|
||||
## Built with and thanks to
|
||||
* [influxdb](https://github.com/influxdata/influxdb)
|
||||
* [Alpine Linux](https://alpinelinux.org/)
|
||||
|
||||
## Tips
|
||||
* Don't bind to ports < 1024 (requires root), use NAT/reverse proxy
|
||||
* [Permanent Stroage](https://github.com/11notes/alpine-docker-netshare) - Module to store permanent container data via NFS/CIFS and more
|
||||
* Use reverse proxy for valid SSL certificates or add your certificates to /influxdb/ssl
|
||||
* Only use rootless container runtime (podman, rootless docker)
|
||||
* Don't bind to ports < 1024 (requires root), use NAT/reverse proxy (haproxy, traefik, nginx)
|
||||
@@ -1,5 +1,5 @@
|
||||
# :: Header
|
||||
FROM influxdb:2.7-alpine
|
||||
FROM influxdb:2.7.3-alpine
|
||||
ENV APP_ROOT=/influxdb
|
||||
|
||||
# :: Run
|
||||
@@ -7,18 +7,19 @@
|
||||
|
||||
# :: update image
|
||||
RUN set -ex; \
|
||||
apk --update --no-cache add \
|
||||
apk --no-cache add \
|
||||
curl \
|
||||
tzdata \
|
||||
shadow; \
|
||||
apk update; \
|
||||
apk upgrade;
|
||||
shadow \
|
||||
openssl; \
|
||||
apk --no-cache upgrade;
|
||||
|
||||
# :: prepare image
|
||||
RUN set -ex; \
|
||||
mkdir -p ${APP_ROOT}; \
|
||||
mkdir -p ${APP_ROOT}/etc; \
|
||||
mkdir -p ${APP_ROOT}/var; \
|
||||
mkdir -p ${APP_ROOT}/ssl; \
|
||||
rm -f /etc/defaults/influxdb2/config.yml; \
|
||||
ln -s ${APP_ROOT}/etc/config.yml /etc/defaults/influxdb2/config.yml; \
|
||||
mv /entrypoint.sh /usr/local/bin;
|
||||
@@ -47,4 +48,4 @@
|
||||
|
||||
# :: Start
|
||||
USER docker
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.custom.sh"]
|
||||
@@ -1,3 +1,4 @@
|
||||
bolt-path: /influxdb/var/influxd.bolt
|
||||
engine-path: /influxdb/var/engine
|
||||
nats-port: 4222
|
||||
tls-cert: "/influxdb/ssl/cert.pem"
|
||||
tls-key: "/influxdb/ssl/key.pem"
|
||||
11
rootfs/usr/local/bin/entrypoint.custom.sh
Normal file
11
rootfs/usr/local/bin/entrypoint.custom.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/ash
|
||||
|
||||
if [ ! -f "${APP_ROOT}/ssl/cert.pem" ]; then
|
||||
openssl req -x509 -newkey rsa:4096 -subj "/C=XX/ST=XX/L=XX/O=XX/OU=XX/CN=XX" \
|
||||
-keyout "${APP_ROOT}/ssl/key.pem" \
|
||||
-out "${APP_ROOT}/ssl/cert.pem" \
|
||||
-days 3650 -nodes -sha256 &> /dev/null
|
||||
fi
|
||||
|
||||
sed -i s#INFLUXD_TLS_CERT='' INFLUXD_TLS_KEY=''## /usr/local/bin/entrypoint.sh
|
||||
/usr/local/bin/entrypoint.sh
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/ash
|
||||
curl --max-time 5 -kILs --fail http://localhost:8086/ping
|
||||
curl --max-time 5 -kILs --fail https://localhost:8086/ping
|
||||
Reference in New Issue
Block a user