5 Commits

Author SHA1 Message Date
ElevenNotes
2270157b45 update 2.7.3 2023-10-19 14:54:23 +02:00
ElevenNotes
ebf3cbd504 add https web ui 2023-09-21 17:10:00 +02:00
ElevenNotes
245634ccc8 added default ssl cert 2023-09-21 17:08:55 +02:00
ElevenNotes
03b3cd2a1d add infos, clear cache 2023-09-20 09:06:22 +02:00
ElevenNotes
b5fa136284 update 2.7.1 2023-09-19 23:07:00 +02:00
5 changed files with 53 additions and 13 deletions

View File

@@ -1,4 +1,6 @@
# Alpine :: InfluxDB # Alpine :: InfluxDB
![size](https://img.shields.io/docker/image-size/11notes/influxdb/2.7.3?color=0eb305) ![version](https://img.shields.io/docker/v/11notes/influxdb?color=eb7a09) ![pulls](https://img.shields.io/docker/pulls/11notes/influxdb?color=2b75d6) ![activity](https://img.shields.io/github/commit-activity/m/11notes/docker-influxdb?color=c91cb8) ![commit-last](https://img.shields.io/github/last-commit/11notes/docker-influxdb?color=c91cb8)
Run InfluxDB based on Alpine Linux. Small, lightweight, secure and fast 🏔️ Run InfluxDB based on Alpine Linux. Small, lightweight, secure and fast 🏔️
## Volumes ## Volumes
@@ -8,25 +10,50 @@ Run InfluxDB based on Alpine Linux. Small, lightweight, secure and fast 🏔️
## Run ## Run
```shell ```shell
docker run --name influxdb \ docker run --name influxdb \
-p 8086:8086 \
-v .../etc/config.yml:/influxdb/etc/config.yml \ -v .../etc/config.yml:/influxdb/etc/config.yml \
-v .../var:/influxdb/var \ -v .../var:/influxdb/var \
-d 11notes/influxdb:[tag] -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 ## Defaults
| Parameter | Value | Description | | Parameter | Value | Description |
| --- | --- | --- | | --- | --- | --- |
| `user` | docker | user docker | | `user` | docker | user docker |
| `uid` | 1000 | user id 1000 | | `uid` | 1000 | user id 1000 |
| `gid` | 1000 | group 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 ## Access
* [influxdb:2.7-alpine](https://github.com/influxdata/influxdata-docker/tree/master/influxdb/2.7/alpine) | 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) * [influxdb](https://github.com/influxdata/influxdb)
* [Alpine Linux](https://alpinelinux.org/) * [Alpine Linux](https://alpinelinux.org/)
## Tips ## Tips
* Don't bind to ports < 1024 (requires root), use NAT/reverse proxy * Use reverse proxy for valid SSL certificates or add your certificates to /influxdb/ssl
* [Permanent Stroage](https://github.com/11notes/alpine-docker-netshare) - Module to store permanent container data via NFS/CIFS and more * Only use rootless container runtime (podman, rootless docker)
* Don't bind to ports < 1024 (requires root), use NAT/reverse proxy (haproxy, traefik, nginx)

View File

@@ -1,5 +1,5 @@
# :: Header # :: Header
FROM influxdb:2.7-alpine FROM influxdb:2.7.3-alpine
ENV APP_ROOT=/influxdb ENV APP_ROOT=/influxdb
# :: Run # :: Run
@@ -7,18 +7,19 @@
# :: update image # :: update image
RUN set -ex; \ RUN set -ex; \
apk --update --no-cache add \ apk --no-cache add \
curl \ curl \
tzdata \ tzdata \
shadow; \ shadow \
apk update; \ openssl; \
apk upgrade; apk --no-cache upgrade;
# :: prepare image # :: prepare image
RUN set -ex; \ RUN set -ex; \
mkdir -p ${APP_ROOT}; \ mkdir -p ${APP_ROOT}; \
mkdir -p ${APP_ROOT}/etc; \ mkdir -p ${APP_ROOT}/etc; \
mkdir -p ${APP_ROOT}/var; \ mkdir -p ${APP_ROOT}/var; \
mkdir -p ${APP_ROOT}/ssl; \
rm -f /etc/defaults/influxdb2/config.yml; \ rm -f /etc/defaults/influxdb2/config.yml; \
ln -s ${APP_ROOT}/etc/config.yml /etc/defaults/influxdb2/config.yml; \ ln -s ${APP_ROOT}/etc/config.yml /etc/defaults/influxdb2/config.yml; \
mv /entrypoint.sh /usr/local/bin; mv /entrypoint.sh /usr/local/bin;
@@ -47,4 +48,4 @@
# :: Start # :: Start
USER docker USER docker
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint.custom.sh"]

View File

@@ -1,3 +1,4 @@
bolt-path: /influxdb/var/influxd.bolt bolt-path: /influxdb/var/influxd.bolt
engine-path: /influxdb/var/engine engine-path: /influxdb/var/engine
nats-port: 4222 tls-cert: "/influxdb/ssl/cert.pem"
tls-key: "/influxdb/ssl/key.pem"

View 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

View File

@@ -1,2 +1,2 @@
#!/bin/ash #!/bin/ash
curl --max-time 5 -kILs --fail http://localhost:8086/ping curl --max-time 5 -kILs --fail https://localhost:8086/ping