Can someone explain (and maybe give a workaround) for the following behavior of docker-compose ?
Given the following files :
Dockerfile
FROM alpine:3.8
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
entrypoint.sh
#!/bin/sh
until [ ! -z "$PLOP" ]; do
echo -n 'enter value here: '
read PLOP
done
echo "Good ... PLOP is $PLOP"
exit 1
docker-compose.yml
version: '3.7'
services:
plop:
tty: true
stdin_open: true
image: webofmars/plop:latest
The output will be the following:
1) ./entrypoint.sh
docker-stdin> ./entrypoint.sh
enter value here:
CASE1
Good ... PLOP is CASE1
Which seems OK
2) docker-stdin> docker run -it webofmars/plop
enter value here: CASE2
Good ... PLOP is CASE2
Which seems OK
3) docker-stdin> docker-compose run plop
enter value here: CASE3
Good ... PLOP is CASE3
Which seems OK
4) docker-stdin> docker-compose up
Recreating docker-stdin_plop_1 ... done
Attaching to docker-stdin_plop_1 (last forever)
Which seems quite odd and NOT OK for my use case
Did i missed something ?