Using alpine:3.17, the following command takes 5 seconds to run (this is what I would expect):
docker run -it alpine:3.17 sh -c "echo A
sleep 1
echo B &
sleep 4
echo C"
First, A is printed, one second later B is printed and finally 4 seconds later C is printed.
In alpine:3.18.0 and alpine:3.18.2 however, the same command takes only one second (not what I would expect):
docker run -it alpine:3.18.2 sh -c "echo A
sleep 1
echo B &
sleep 4
echo C"
First A is printed, and one second later B and C are printed together after which the container exits immediately.
Why is this, and is there a way to get the old behavior?
This behavior is causing some issues for me as I'm trying to run a loop where I sleep in-between running commands in the background, but the sleeps get ignored causing the loop to run way too fast.
Sorry if I missed any available information about this.
Using alpine:3.17, the following command takes 5 seconds to run (this is what I would expect):
First, A is printed, one second later B is printed and finally 4 seconds later C is printed.
In alpine:3.18.0 and alpine:3.18.2 however, the same command takes only one second (not what I would expect):
First A is printed, and one second later B and C are printed together after which the container exits immediately.
Why is this, and is there a way to get the old behavior?
This behavior is causing some issues for me as I'm trying to run a loop where I sleep in-between running commands in the background, but the sleeps get ignored causing the loop to run way too fast.
Sorry if I missed any available information about this.