Reputation: 511
I am thinking of using docker to deliver a software service. The service is written in scripting language (e.g. Python, NodeJS etc), so the docker image will have the source code. Is it easy to "peek" into the docker image to see the source code?
I know this is not the intended use case of docker, but your answers will help me understand better how docker works.
Thanks!
Upvotes: 4
Views: 3670
Reputation: 12913
No, your code won't be hidden at all.
A Docker image is a stack of "layers" that end up being mounted just as a regular filesystem.
Anyone having access to the image can thus see everything that's inside.
You should better consider compiling and/or obfuscating your code, such solutions exist for both Python and NodeJS.
Upvotes: 3
Reputation: 93934
You can use docker run -t -i imageName bash
to enter the interactive mode. Then reveal the codes.
Upvotes: 2