I'm still a newbie in the Docker area. I'm just getting confused about this from this Docker-run command:
docker run -d --name fritzbox_smarthome_exporter -p 9103:9103 \
-v $(pwd)/boxcert.cer:/fritzbox.pem:ro \
-e PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
-e PASSWORD=ChefsPassWord \
-e USERNAME=chef \
jaymedh/fritzbox_smarthome_exporter '-noverify=false' '-url=http://fritz.box' '-cert=/fritzbox.pem'
to create a corresponding docker-compose.yml
file.
Can someone enlighten a blind person? Thanks.
This is my design:
version: '3.8'
services:
fritzbox_smarthome_exporter:
image: 'jaymedh/fritzbox_smarthome_exporter:latest'
restart: unless-stopped
ports:
- '9103:9103'
environment:
USERNAME=Chef
PASSWORD=cHefsPw
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
volumes:
- $(pwd)/boxcert.cer:/fritzbox.pem:ro
command: noverify=false url=http://192.168.0.2 cert=/fritzbox.pem
But Portainer throws the following error message:
failed to deploy a stack: validating /data/compose/25/docker-compose.yml: services.fritzbox_smarthome_exporter1.environment must be a mapping
Even if I replace the variable with the regular path on the system ( - /opt/fritz_smarthome_exporter/boxcert.cer:/fritzbox.pem:ro
), I get an error.
version: '3.8'
services:
fritzbox_smarthome_exporter:
image: 'jaymedh/fritzbox_smarthome_exporter:latest'
restart: unless-stopped
ports:
- '9103:9103'
environment:
USERNAME=Chef
PASSWORD=cHefsPw
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
volumes:
- /opt/fritbox_smarthome_exporter/boxcert.cer /fritzbox.pem:ro
command: noverify=false url=http://192.168.0.2 cert=/fritzbox.pem
the Error: failed to deploy a stack: validating /data/compose/38/docker-compose.yml: volumes must be a mapping
can anyone help me ?