I have a container, it starts with shell script.sh such as:
FROM bash:4.4 COPY script.sh / COPY process.sh / CMD ["bash", "/script.sh"] Here is script.sh:
#!/bin/sh sh process.sh & for i in {1..10000} do sleep 1 echo "Looping ... number $i" done It starts another process by running process.sh script.
Here is the process.sh script:
#!/bin/sh for i in {1..10} do sleep 1 echo "I am from child process ... number $i" done Now I want to see all the stdout message. If I go to the directory like /var/lib/docker/containers/container_sha: I see something like below:
I am from child process ... number {1..10} Looping ... number 1 Looping ... number 2 Looping ... number 3 Looping ... number 4 Looping ... number 5 Looping ... number 6 ..... It is obvious that, I see only the script.sh output but not process.sh
Why is that? And how can i get all the logs?
Note: docker logs containerName does the same.
It is obvious that, I see only the script.sh output but not process.shwhere do you think the lineI am from child process ... number {1..10}comes from?