Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5962

Add a non root user to docker image in eclipse-temurin:17-focal

$
0
0

Hi i have created a spring boot application and want to add a non root user to in the docker file.

i was looking at the followinghttps://spring.io/guides/topicals/spring-boot-docker/

and this command

RUN addgroup -S demo && adduser -S demo -G demoUSER demo

but this doesnt work in my docker file which is based on the followin image

FROM eclipse-temurin:17-focalWORKDIR /appCOPY target/*.jar app.jarEXPOSE 8080RUN addgroup -S demo && adduser -S demo -G demoUSER demoENTRYPOINT ["java","-jar","/app.jar"]

Error:

error: failed to solve: process "/bin/sh -c addgroup -S app && adduser -S app -G app" did not complete successfully: exit code: 1

Viewing all articles
Browse latest Browse all 5962

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>