puppetlabs / puppetlabs/puppetlabs-docker

Docker Compose always restart container

Open
#1,003 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Ruby
Stars
94
Forks
337
Avg merge
11d 15h
Merged PRs (30d)
2

Description

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

  • Debian 12
  • Docker last version
  • Puppet docker module 10.0.1

Additional Context

Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the repeated docker_compose resource application with the provided cadvisor compose file and compare the container state across runs. Done means an already-running container is left running without a rebuild or restart when the compose configuration has not changed.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.