I'm trying to build and run the image with a non-root user and keep getting the error: "unable to find user test: no matching entries in passwd file."
Here's what my Docker file looks like:
FROM openjdk:11-jre-slim
RUN addgroup --system test
RUN adduser --system testuser --ingroup test
USER test:testuser
COPY build/libs/abc-0.0.1.jar app.jar
ENTRYPOINT ["java","-jar", "app.jar"]
I already tried searching for the error and looked at other places but none seems to work for me. Could someone help me out here? I know I can run it with the root user but I don't want to or if there's another Openjdk11 image that I could use to make it work then that's also fine.