Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error building with temurin-17: adduser not found #606

Closed
haphazardeous opened this issue Jul 23, 2024 · 8 comments
Closed

[Bug]: Error building with temurin-17: adduser not found #606

haphazardeous opened this issue Jul 23, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@haphazardeous
Copy link

haphazardeous commented Jul 23, 2024

Please add the exact image (with tag) that you are using

eclipse-temurin:17

Please add the version of Docker you are running

docker:20.10.16

What happened?

Our Dockerfile contains the following

FROM eclipse-temurin:17
RUN adduser --system --group spring
USER spring:spring
.
.
.

This has been working fine but this morning we couldn't run any of our builds as all of them failed with the following

#5 [2/5] RUN adduser --system --group spring
#5 sha256:e77de5906a7a076deb83aff9a4beb9a33be7a535eeab19f1b4904f5a100a460e
#5 0.170 /bin/sh: 1: adduser: not found
#5 ERROR: executor failed running [/bin/sh -c adduser --system --group spring]: exit code: 127
------
 > [2/5] RUN adduser --system --group spring:
------
executor failed running [/bin/sh -c adduser --system --group spring]: exit code: 127

Can anyone help on this?

Many thanks,
Vedat

Relevant log output

No response

@haphazardeous haphazardeous added the bug Something isn't working label Jul 23, 2024
@LaSylv
Copy link

LaSylv commented Jul 23, 2024

Same error, with addgroup

@LaSylv
Copy link

LaSylv commented Jul 23, 2024

I circumvented the problem by using groupadd

It is not a dropin replacement but is pretty easy to do

RUN addgroup --gid $GID --system spring && adduser --uid $UID --ingroup spring --disabled-password spring became
RUN groupadd --gid $GID spring && useradd --uid $UID --gid spring --system --no-create-home --shell /usr/sbin/nologin spring

@hungchu0912
Copy link

+1 with addgroup

@haphazardeous
Copy link
Author

I tried openjdk-java:17 and the issue persisted. Might not be related to temurin

@pcdavid
Copy link

pcdavid commented Jul 23, 2024

From what I understand, this commit from 2 week ago changed the default base image from Ubuntu focal (20.04) to Ubuntu noble (24.04).

The official ubuntu:focal image used to have useradd installed by default, but ubuntu:noble does not:

Capture d’écran du 2024-07-23 12-00-18

@darioseidl
Copy link

With eclipse-temurin:17-jre-focal instead of eclipse-temurin:17-jre as base image, addgroup and adduser work again.

@gdams
Copy link
Member

gdams commented Jul 23, 2024

Hi all, thanks for raising this issue, this is due to the change of the latest tag from jammy to noble. As @darioseidl correctly points out you can stay on the older Ubuntu base using eclipse-temurin:17-focal or eclipse-temurin:17-jammy

An alternative in noble would be to install the adduser package:

FROM eclipse-temurin:17

RUN apt-get update && apt-get install -y adduser

# rest of your code

@haphazardeous
Copy link
Author

Thanks for all the help everyone. I’m now closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants