Estou com o Seguinte erro ao criar o Docker image no linux:
$ sudo docker build - < Dockerfile
[+] Building 1.2s (6/8)
=> [internal] load build definition from Dockerfile
=> => transferring dockerfile: 232B
=> [internal] load .dockerignore
=> => transferring context: 2B
=> [internal] load metadata for docker.io/library/openjdk:17
=> [internal] load build context
=> => transferring context: 2B
=> CACHED [1/4] FROM docker.io/library/openjdk:17@sha256:528707081fdb9562eb819128a9f85ae7fe000e2fbaeaf9f87662e7b3f38cb7d8 0.0s
=> ERROR [2/4] RUN addgroup -S spring && adduser -S spring -G spring 0.6s
------
> [2/4] RUN addgroup -S spring && adduser -S spring -G spring:
#0 0.547 /bin/sh: addgroup: command not found
------
Dockerfile:2
--------------------
1 | FROM openjdk:17
2 | >>> RUN addgroup -S spring && adduser -S spring -G spring
3 | USER spring:spring
4 | WORKDIR /app
--------------------
ERROR: failed to solve: process "/bin/sh -c addgroup -S spring && adduser -S spring -G spring" did not complete successfully: exit code: 127
Meu Dockerfile esta assim:
FROM openjdk:17
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
WORKDIR /app
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.janvmr"]