Those who followed best practices in software development
would start with a clean environment I.e. installation of operating system. Then install development tools keeping a record of version numbers. So that at the time of deployment unforeseen errors are avoided by duplicating development environment , test environment , final client runtime environment.
That is now the purpose of docker.
So if you want run same source code or byte code in different environments then you should run it. If you can programme and ask this question then you should know how to.