remove files from inside the container after the build. Can you do it?

1

How to delete files after build? I am "building" an image with a google cloud key, so I can not leave this key inside the container, for security reasons. The problem is that if I do not, google cloud will not authenticate. Or is there another way for me to authenticate the google cloud key from outside the container?

    
asked by anonymous 04.12.2017 / 15:57

1 answer

1

Multi-stage builds is a docker feature designed exactly for this scenario , however it does something slightly different. Instead of removing files, you only copy to the last stage the binary files, leaving all other files in the previous stages. The resulting image contains only the last stage, all the predecessors only exist during the build.

    
05.12.2017 / 03:35