yichen
yichen

Reputation: 511

Does docker image hide my source code?

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

Answers (2)

mbarthelemy
mbarthelemy

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

waitingkuo
waitingkuo

Reputation: 93934

You can use docker run -t -i imageName bash to enter the interactive mode. Then reveal the codes.

Upvotes: 2

Related Questions