1

I am creating docker images for my python application.I have to share it with others.

When we run

docker save

using this command we can create a tar of docker image.Tar file contain of the layer of images and inside folder whole application code may expose.

is there a way to hide code or white label the docker image or i have to do it from python side.

Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
  • 1
    Instead of "docker save" I suggest you push your image to a docker registry. You can create a registry of your own where only you can push and other can pull from there. Is this what you are looking for? Otherwise can you explain better the problem you are trying to solve? – Mihai Apr 22 '19 at 08:12
  • Docker registry i know but what if some one have access to registry and download the docker image locally and run command `docker save` so that will get tar file of docker image and can have also access of code. – Harsh Manvar Apr 22 '19 at 08:32
  • 1
    I think your problem is this: [How do I protect Python code?](https://stackoverflow.com/questions/261638/how-do-i-protect-python-code) Check also [this](https://stackoverflow.com/a/26108342/1561148). – tgogos Apr 22 '19 at 08:34
  • kind of but i am storing python code inside docker image – Harsh Manvar Apr 22 '19 at 08:36
  • 1
    @HarshManvar Then you can only do it from inside the container. But I would be very careful to download and run a container from internet on my machine without seeing what exactly it is doing. – Mihai Apr 22 '19 at 08:37
  • so i have to add pyc compiled python file as code insode docker image ? – Harsh Manvar Apr 22 '19 at 08:39
  • Use a multistage build and remove the initial code when you are done encrypting it or whatever you do with it. – Mihai Apr 22 '19 at 08:39
  • yes kind of similar and duplicate thankyou so much – Harsh Manvar Apr 22 '19 at 08:50

0 Answers0