Hi lvhengani, from the error output it is difficult to debug the issue, could you post your Dockerfile and the command used to run the container, so I can do some further investigation.
Maybe useful is a repository on GitHub I setup to share efforts developing ‘community maintained SNAP Docker containers’; feel free to browse, borrow and/or contribute. So far I did not get Sen2Cor setup, but considering the dependencies/complexities of getting it working this is an ideal candidate. GitHub - edwardpmorris/docker-snap: A Docker container including ESA-STEP Sentinel Application Platform (SNAP, http://step.esa.int/main/toolboxes/snap/) and Sentinel toolboxes jointly developed by Brockmann Consult, Array Systems Computing and C-S.
Also, included is a post about ‘headless’ installation in Unix (for setting up Docker containers).
regards Ed.