spring-attic / top-spring-boot-docker

Spring Boot Docker:: Topical guide to using Docker and how to create container images for Spring Boot applications :: spring-boot
https://spring.io/guides/topicals/spring-boot-docker
180 stars 127 forks source link

Add explanation and example on how to prevent running app as root user #5

Closed cy4n closed 5 years ago

cy4n commented 5 years ago

by "Principle of least Privilege", no app should run with root permissions if not absolutely necessary

dsyer commented 5 years ago

This works:

RUN addgroup -S demo && adduser -S demo -G demo
cy4n commented 5 years ago

you're right, i copied from my debian-based dockerfile:-O my bad. anyway, with your update it achieved what i wanted,)