ewolff / microservice

Sample of a Microservice setup for my book. Based on Spring Cloud / Netflix / Java / Docker / Docker Compose / Docker Machine / Vagrant
Apache License 2.0
725 stars 352 forks source link

Don’t run docker processes as root user #21

Closed nikos closed 4 years ago

nikos commented 7 years ago

Inspired by Halil-Cem's talk about Docker best practices today at BedCon, I would suggest to give it a try and see wether the Java processes for each of the Spring Boot microservice applications could run as a non-root user to avoid potential security traps.

See also:

ewolff commented 7 years ago

Thanks a lot for the suggestion! The main goal of this as well as the other demos is to make it as easy as possible to run the demo. It seems that I would need to create a user in the host operating system. I am not even sure how that works if you run Docker on Mac / Windows. In other words: Any idea what needs to be done except for the USER in the Dockerfile - in particular concerning the configuration of the host?

ewolff commented 4 years ago

While I do see the point, I decided not to implement the suggestion. The demo is not meant to be production-ready. Instead it should be easy to run and understand. I made other compromises, too - e.g. all microservices are build with one single build script.