ConSol-Monitoring / omd-labs-docker

Docker images with OMD labs edition
https://labs.consol.de/omd/
22 stars 14 forks source link

Volume mounts not working with NEW_SITENAME ARG set #21

Closed dmp1ce closed 5 years ago

dmp1ce commented 5 years ago

I tried to set a new site name with ARG parameter which worked for creating a new site it looked like but my volume mounts were not being detected. How can I get volume mounts detected for NEW sites? Here is my docker-compose.yaml I used to test.

version: "3"

services:
  monitor:
    build:
      context: .
      args:
        NEW_SITENAME: "mysite"
    ports:
      - "8443:443"
    volumes:
      - "./etc:/opt/omd/sites/mysite/etc.mount"
      - "./local:/opt/omd/sites/mysitelocal.mount"
      - "./var:/opt/omd/sites/mysite/var.mount"

Dockerfile

FROM consol/omd-labs-ubuntu

Output on terminal:

$ docker-compose build
Building monitor
Step 1/1 : FROM consol/omd-labs-ubuntu
# Executing 3 build triggers
 ---> Using cache
 ---> Running in f04694a3b75f
Removing intermediate container f04694a3b75f
 ---> Running in c494c77fba11
CREATE new site:mysite
Removing Crontab...no crontab for demo
Stopping dedicated Apache for site demo...(not running)...OK
Stopping naemon...not running...OK
npcd was not running... could not stop
Stopping rrdcached...not running.
Removing /omd/sites/demo/tmp from /etc/fstab...OK
Deleting user and group demo...OK
Adding /omd/sites/mysite/tmp to /etc/fstab.
Preparing tmp directory /omd/sites/mysite/tmp...OK
Adding /omd/sites/mysite/tmp to /etc/fstab.
Created new site mysite with version 2.91.20190223-labs-edition.

  The site can be started with omd start mysite.
  The default web UI is available at https://c494c77fba11/mysite/

  The admin user for the web applications is omdadmin with password: xRDEf3kS
  (It can be changed with the 'set_admin_password' command as site user.)

  Please do a su - mysite for administration of this site.

Removing intermediate container c494c77fba11
 ---> 77e65ab25b7d
Successfully built 77e65ab25b7d
Successfully tagged albatross-monitoring_monitor:latest

$ docker-compose up -d && docker-compose logs -f
Recreating albatross-monitoring_monitor_1 ... done
Attaching to albatross-monitoring_monitor_1
monitor_1  | Config and start OMD site: mysite
monitor_1  | --------------------------------------
monitor_1  | Checking for volume mounts...
monitor_1  | --------------------------------------
monitor_1  |  * local/: [No Volume]
monitor_1  |  * etc/: [No Volume]
monitor_1  |  * var/: [No Volume]
monitor_1  | 
monitor_1  | 
monitor_1  | Checking for Ansible drop-in...
monitor_1  | --------------------------------------
monitor_1  | Nothing to do (/root/ansible_dropin/playbook.yml not found).
monitor_1  | 
monitor_1  | crond: Starting ...
monitor_1  | --------------------------------------
monitor_1  | /root/start.sh: line 87: crond: command not found
monitor_1  | 
monitor_1  | omd-labs: Starting site mysite...
monitor_1  | --------------------------------------
monitor_1  | Preparing tmp directory /omd/sites/mysite/tmp...Starting rrdcached...OK
monitor_1  | Starting npcd...OK
monitor_1  | Starting naemon...OK
monitor_1  | Starting dedicated Apache for site mysite...OK
monitor_1  | Initializing Crontab...OK
monitor_1  | OK
monitor_1  | 
monitor_1  | omd-labs: Starting Apache web server...
monitor_1  | --------------------------------------
monitor_1  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.24.0.2. Set the 'ServerName' directive globally to suppress this message
sni commented 5 years ago

thanks, should be fixed with: b89b2d4b861