Skip to content

Detached mode executes entrypoint twice #1176

Closed
@Fedma123

Description

@Fedma123

Describe the bug
podman-compose up -d executes the container entrypoint twice.

To Reproduce
Dockerfile

FROM docker.io/debian:bookworm

COPY ./init.sh /root/

compose.yaml

services:
  test:
    image: test-image:latest
    container_name: test
    build:
      context: .
      dockerfile: Dockerfile
    entrypoint: ["/bin/bash", "/root/init.sh"]

init.sh

#!/bin/bash
file="/root/store.txt"

if [ ! -f $file ]; then
  echo 1 > $file
  value=1
else
  value=$(cat $file)
  value=$((value + 1))
fi

echo "$value"

Expected behavior
podman logs test should output:

1

Actual behavior
podman logs test outputs:

1
2

Environment:

  • OS: Fedora 41
  • podman version: 5.4.1
  • podman compose version: 1.3.0

Additional context

podman compose up behaves as expected:

podman logs test outputs:

1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions