sebfisch / docker-java-dev

A Docker container for terminal based Java development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build fails when existing user or group is provided as build arg

sebfisch opened this issue · comments

The Dockerfile respects build args for the name and IDs of the created user and their initial group. There is no check if the name or ID of of a given user or group already exists, which leads to an error when building the container image, for example when passing staff as GROUP.

The expected behaviour is as follows:

  • When root is provided as USER, no new group and no new user is created.
  • When the provided UID already exists (equals roots ID 0) the default value for UID is used.
  • When GID already exists, no new group is created.
  • When GROUP already exists, USER is used as value for GROUP.