Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Erro ao gerar a imagem

Meu Dockerfile:

FROM openjdk:15-jdk-slim-buster RUN addgroup -S spring && adduser -S spring -G spring USER spring:spring ARG JAR_FILE=target/*.jar COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-jar","/app.jar"]

O erro apresentado ao rodar o comando: $ docker build -t alura/forum .

#6 [2/3] RUN addgroup -S spring && adduser -S spring -G spring

#6 sha256:9419aa1e7cdc3174e7e51c4301af0724e13ff99c42404e0d0f8548d3f9bb1547

#6 0.267 Option s is ambiguous (shell, system)

#6 0.267 adduser [--home DIR] [--shell SHELL] [--no-create-home] [--uid ID]

#6 0.267 [--firstuid ID] [--lastuid ID] [--gecos GECOS] [--ingroup GROUP | --gid ID]

#6 0.267 [--disabled-password] [--disabled-login] [--add_extra_groups] USER

#6 0.267 Add a normal user

#6 0.267

#6 0.267 adduser --system [--home DIR] [--shell SHELL] [--no-create-home] [--uid ID]

#6 0.267 [--gecos GECOS] [--group | --ingroup GROUP | --gid ID] [--disabled-password]

#6 0.267 [--disabled-login] [--add_extra_groups] USER

#6 0.267 Add a system user

#6 0.267

#6 0.267 adduser --group [--gid ID] GROUP

#6 0.267 addgroup [--gid ID] GROUP

#6 0.267 Add a user group

#6 0.267

#6 0.267 addgroup --system [--gid ID] GROUP

#6 0.267 Add a system group

#6 0.267

#6 0.267 adduser USER GROUP

#6 0.267 Add an existing user to an existing group

#6 0.267

#6 0.267 general options:

#6 0.267 --quiet | -q don't give process information to stdout

#6 0.267 --force-badname allow usernames which do not match the

#6 0.267 NAME_REGEX configuration variable

#6 0.267 --help | -h usage message

#6 0.267 --version | -v version number and copyright

#6 0.267 --conf | -c FILE use FILE as configuration file

#6 0.267

#6 ERROR: executor failed running [/bin/sh -c addgroup -S spring && adduser -S spring -G spring]: exit code: 1

[2/3] RUN addgroup -S spring && adduser -S spring -G spring:


executor failed running [/bin/sh -c addgroup -S spring && adduser -S spring -G spring]: exit code: 1

2 respostas
solução!

Oi Bruno,

Altere essa linha:

RUN addgroup -S spring && adduser -S spring -G spring

Para:

RUN addgroup --system spring && adduser --system spring -G spring

Veja se o problema é resolvido com isso.

Resolvido assim:

Meu Dockerfile:

FROM openjdk:16-jdk-alpine RUN addgroup -S spring && adduser -S spring -G spring USER spring:spring ARG JAR_FILE=target/*.jar COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-jar","/app.jar"]

E gerei o build da aplicação e rodei o comando para gerar a imagem, e funcionou !