I am using docker compose for multi-container setup for my project. For that I need some data in my mongodb image and I have created a python file for same. Now in the build process, I am only getting below message in the console and not any other stdout/sterr messages.
Step 12 : CMD python ./import_testdata.py
---> Running in 352b86106f68
CMD ["/bin/sh", "-c", "python import_testdata.py > server.log 2>&1"]
CMD [ "python", "./import_testdata.py" ]
The Docker Reference states: "There can only be one CMD instruction in a Dockerfile. If you list more than one CMD then only the last CMD will take effect." (https://docs.docker.com/engine/reference/builder/)
Why don't you perform your actions with a RUN instruction?