Docker Community Forums

Share and learn in the Docker community.

Upgrade container alertmanager / Prometheus / Grafana

Hello,

I have actualy a old version docker image of

AlertManager => 0.16.2

Prometheus => 2.9.1

Grafana => 6.1.6

My actual containers are running

I would like to update my containers without loosing my parameters and data

Please find below a old ansible script

  • name: Start container monitor_alertmanager

docker_container:

user: root

name: monitor_alertmanager

image: build:12001/prom/alertmanager:v0.16.2

volumes:

  • /opt/monitor-server/conf:/etc/prometheus

  • /monitor/server/data/alertmanager:/alertmanager

command:

  • ‘–config.file=/etc/alertmanager/alertmanager.yml’

  • ‘–storage.path=/alertmanager’

ports:

  • “9093:9093”

state: started

restart_policy: always

  • name: Start container monitor_prometheus

docker_container:

user: root

name: monitor_prometheus

image: build:12001/prom/prometheus:v2.9.1

volumes:

  • /opt/monitor-server/conf:/prometheus

  • /monitor/server/data/prometheus:/data

command:

  • ‘–config.file=/prometheus/prometheus.yml’

  • ‘–storage.tsdb.path=/data’

  • ‘–storage.tsdb.retention.time=360d’

  • ‘–web.enable-lifecycle’

links:

  • “monitor_alertmanager”

ports:

  • “9090:9090”

state: started

restart_policy: always

  • name: Start container monitor_grafana

docker_container:

user: root

name: monitor_grafana

image: build:12001/grafana/grafana:6.1.6

volumes:

  • /opt/monitor-server/grafana:/etc/grafana/

  • /monitor/server/data/grafana:/var/lib/grafana

links:

  • “monitor_prometheus”

ports:

  • “3000:3000”

state: started

restart_policy: always

  • name: force restart ?

meta: flush_handlers

I have an error message

TASK [Start container monitor_alertmanager] *************************************************************************************************************************************************************************************************

fatal: ]: FAILED! => {“changed”: false, “msg”: “Error starting container f12ed46bc754008b8750e2ac05bbf1624275a8d1c2667a7504cad4e762331733: 400 Client Error: Bad Request (”{“message”:"OCI runtime create failed

: container_linux.go:349: starting container process caused \“exec: \\\”–config.file=/prometheus/alertmanager.yml\\\": stat --config.file=/prometheus/alertmanager.yml: no such file or directory\": unknown"}")"}

to retry, use: --limit @/toto/docker-alert-manager.retry

Would somebody knows to translate my playbook in “DOCKER RUN” command please ?

Regards.