Closed
Description
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