Skip to content

Building image with own UID=xxxxxx and GID =100 #174

@Nguimjeu

Description

@Nguimjeu

Because of non-matching UID/GID between host system and the wodby/php image, I'm trying to build my own image (for development purposes). The build process however fails when trying to delete the group the I gave as parameter. Here the details:

My en_make file.

// ./en_make

PHP_VER=8.1.10
PHP_DEV=1
WODBY_USER_ID=1853894834
WODBY_GROUP_ID=100

The WODBY_USER_ID and WODBY_GROUP_ID correspond to the UID and primary GID of my user on the host system.

The command I use to launch the build process.

$ make buildx-build-amd64

Build output with error message (truncated):

docker buildx build --platform linux/amd64 -t wodby/php:8.1-dev \
        --build-arg PHP_VER=8.1.10 \
        --build-arg PHP_DEV=1 \
        --build-arg WODBY_USER_ID=1853894834 \
        --build-arg WODBY_GROUP_ID=100 \
        --build-arg PECL_HTTP_PROXY="" \
        --load \
        ./
[+] Building 2.5s (6/10)                                                                                                                                                                                                         
 => [internal] load build definition from Dockerfile   

...
 => ERROR [2/6] RUN set -xe;         existing_group=$(getent group "${WODBY_GROUP_ID}" | cut -d: -f1); ...

...

#0 0.603 + getent group 100
#0 0.604 + cut -d: -f1
#0 0.604 + existing_group=users
#0 0.604 + '[[' -n users ]]
#0 0.605 + delgroup users
#0 0.605 delgroup: 'guest' still has 'users' as their primary group!

...

make: *** [Makefile:55: buildx-build-amd64] Error 1

If I'm not wrong, the build process fails because it is trying to delete the group with id 100.

Question:

While the user on my host system belongs to other groups that I can use for the build process, is it possible, instead of trying to delete the group, to add the user to the existing group in the docker image?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions