In theory, Docker can help:
- Project source code is closed and not published anywhere, the same applies to the Dockerfile. You distribute only ready-made Docker images.
- When you build a Docker image encrypted files of the program, whether .nick jar', binary or naked php'shnye source.
- Decryption requires a license key which must preobrazyatsya into the container at startup via environment variables. It program files rasshifrovat and the program starts.
In practice, you get the same as piracy various software today:
- One who has the key can put it in the public domain. This moment can be bypassed, if you think of any centralized verification key on their servers (see how to make JetBrains). Or under each key generates a unique separate Docker image. Again, anyone who has a key, and has accordingly, and he, too, can share.
- He who possesses the key can easily pick open a container via docker exec. And if the program files themselves reflect well the source code (e.g. PHP scripts or binaries Go), here leaked already and the source code of Your product that is not comme Il faut. So code obfuscation and other techniques of protection of the results of the compilation should not be neglected.
In General, sticks in wheels to insert, you can "hoo-go", but a complete solution of the problem, IMHO, is no. Because piracy and thrives, because it is possible.