0

I know there are several ways to enter a running container,

  1. docker attach container_id
  2. nsenter
  3. docker exec -it container_id /bin/bash

now my question is I want to distribute the container of mine, but I don't want to expose the source code which in container.

is there any solution of this? or any good suggestions to achieve the goal?

user7693832
  • 6,119
  • 19
  • 63
  • 114
  • Docker does not provide any obfuscation layers. A Docker image is just a set of compressed tarballs. For these files in the image to run at all, they must be readable. Once a container is running, it is fully running on the host where Docker is running and any superuser can do anything with any process on that host. Code obfuscation falls outside the scope of Docker. You can likely use any existing obfuscation tool in conjunction with Docker. – programmerq Jul 15 '21 at 03:20
  • It's very easy to see what's inside a Docker container or image; if you can run any `docker` command, then it's also very easy to see any file on the host. Docker doesn't provide any facilities for hiding the contents of an image. The only real way to achieve this is by not distributing the source at all (use a compiled language like Go or Rust). – David Maze Jul 15 '21 at 04:13

0 Answers0