this post was submitted on 26 Nov 2023
1 points (100.0% liked)

Portainer

28 readers
0 users here now

Portainer Community Edition is a lightweight service delivery platform for containerized applications that can be used to manage Docker, Swarm, Kubernetes and ACI environments.

founded 11 months ago
MODERATORS
 

I'm using Community Edition trying to use 'Stacks' which resides on a proxmox node.

I'm a bit confused how to read in config files to portainer from either a git repo or locally.

For example, I have this example in my docker-compose.yml file where I read in a config file in the same directory called 'prometheus.yml':

version: '3'

services:
  prometheus:
    image: prom/prometheus
    container_name: prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--web.enable-lifecycle'
    ports:
      - 9090:9090
    restart: unless-stopped
    volumes:
      - /home/phil/gitrepos/prometheusTesting/:/etc/prometheus/
      - prom_data:/prometheus
volumes:
  prom_data:

The stack launched but then in the container log I saw this error:

ts=2023-11-26T18:36:49.719Z caller=main.go:487 level=error msg="Error loading config (--config.file=/etc/prometheus/prometheus.yml)" file=/etc/prometheus/prometheus.yml err="read /etc/prometheus/prometheus.yml: is a directory"

I also tried via git repository but portainer complaine about the relative path which has thrown me because I thought portainer would just clone the repo and run as is..

version: '3'

services:
  prometheus:
    image: prom/prometheus
    container_name: prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--web.enable-lifecycle'
    ports:
      - 9091:9091
    restart: unless-stopped
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
      - prom_data:/prometheus

So.. How do I handle passing in these config files? Any examples would be super useful.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here