puppetlabs / puppetlabs-docker

The Puppet Docker repository
Apache License 2.0
91 stars 311 forks source link

Docker Compose always restart container #1003

Open judzk opened 2 weeks ago

judzk commented 2 weeks ago

Describe the Bug

Docker Compose always restart container

Expected Behavior

If the container is running, docker compose should not restart the container

Steps to Reproduce

Steps to reproduce the behavior:

Use a docker compose

  docker_compose { 'cadvisor':
    ensure        => present,
    compose_files => ["${docker_data}/cadvisor/docker-compose.yaml"],
  }

Info: Checking for compose project cadvisor Info: Checking for compose service cadvisor gcr.io/cadvisor/cadvisor:v0.49.1 Info: Checking for compose project cadvisor Info: Checking for compose service cadvisor gcr.io/cadvisor/cadvisor:v0.49.1 Info: Rebuilding and Restarting all containers for compose project cadvisor Info: Running compose project cadvisor Notice: /Stage[main]/Cl_docker::Config/Docker_compose[cadvisor]: Triggered 'refresh' from 1 event

services:
  cadvisor:
    image: gcr.io/cadvisor/cadvisor:v0.49.1
    container_name: cadvisor
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:ro
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro
      - /dev/disk/:/dev/disk:ro
    command:
    - '-port=8098'
    ports:
      - 8098:8098
    privileged: true
    devices:
      - /dev/kmsg

Environment

Additional Context

Add any other context about the problem here.