influxdata / influxdata/influxdata-docker

Cannot start influxdb in docker with letsencrypt

Open
#602 0 comments 1 reaction 0 assignees View on GitHub
influxdb
Dominant language
Shell
Stars
364
Forks
255
Avg merge
3h 18m
Merged PRs (30d)
7

Description

Hello. I'm trying to start InfluxDB in docker using the letsencrypt certs from host. This is my compose file:
```yml
version: '3.6'
services:
influxdb:
image: influxdb:2.1.1
ports:
- 8086:8086
volumes:
- /opt/influxdb/data:/var/lib/influxdb2
- /opt/influxdb/config.yml:/etc/influxdb2/config.yml
- /etc/letsencrypt/live/example.com/cert.pem:/etc/letsencrypt/live/example.com/cert.crt:ro
- /etc/letsencrypt/live/example.com/privkey.pem:/etc/letsencrypt/live/example.com/privkey.key:ro
```
I'm getting the following error:
```
influxdb-influxdb-1 | Error: open /etc/letsencrypt/live/example.com/privkey.key: permission denied
```

If I run the `whoami` command in the container by adding `command: whoami` to compose file, it gives the following output:
```
Attaching to influxdb-influxdb-1
influxdb-influxdb-1 | root
```
And this is the permissions of files (output of running `command: ls -l /etc/letsencrypt/live/example.com/privkey.key`):
```
influxdb-influxdb-1 | -rw------- 1 root root 1700 Apr 1 18:33 /etc/letsencrypt/live/example.com/privkey.key
```

Why can't influxdb open this file if it is run as root and the file is also owned by root?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided Docker Compose file and reproduce the failure using influxdb:2.1.1 and the two mounted Let's Encrypt files. Inspect the mounted file permissions and container access context, then verify the result by starting the service successfully and confirming InfluxDB can open privkey.key.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose
Domain
infrastructure, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.