0

I have source code in docker images which I have to protect from the copy.

I have set up a password in the image but when I run command docker exec -it container-name /bin/bash then it login without password.

How to set any protect so when anyone run above command then it will ask password for that so I can protect my source from the copy.

Mehul Katara
  • 907
  • 11
  • 32
  • That is _not_ going to successfully stop your source code from being copied by any minimally-competent attacker. You _can't_ stop someone from copying content out of your Docker image, if they have root on the host where it's being run, because someone with root access can use `nsenter` to inject a process into any namespace they choose, including the filesystem namespaces assembled by Docker. – Charles Duffy Nov 02 '20 at 19:02
  • And even if you somehow stopped people from using nsenter, they could still just read the data directly out from wherever Docker is getting it (the details depend on which storage backend it's configured for, but for _every possible backend_ it's still possible for someone to do the same work Docker is doing themselves / by hand). – Charles Duffy Nov 02 '20 at 19:04
  • Anyone who can run any `docker` command at all can pretty trivially get root access to the system, run any command, and inspect any file in any container. You need to use a compiled language if you don't want to distribute your source; it simply being in a Docker image won't protect it in any meaningful way. – David Maze Nov 02 '20 at 19:43

0 Answers0