Skip to content

WORKSPACE_PUID ignored when building workspace container #3649

Closed

Description

@AlexSemionov

Description:

When building the workspace container with a custom WORKSPACE_PUID value, the resulting laradock user is still created with UID 1000, regardless of the specified value.

This seems to be caused by the conditional user creation logic introduced as a workaround for PHP 8.x images: #3638 (comment)

As a result, the custom PUID and PGID environment variables are ignored for PHP versions greater than 8.0.

Expected Behavior:

The laradock user and group should be created with the UID and GID specified in .env, for all supported PHP versions

Context information:

Output of git rev-parse HEAD

41664649eba71c1fba9631834b2b3f1f9bd45d11

Output of docker version

Docker version 27.0.3, build 7d4bcd8

System info: Mac, Windows or Linux. Include which disto/version

Ubuntu 22.04.4 LTS

Steps to reproduce the issue:

  1. git clone https://github.com/laradock/laradock.git
  2. cd laradock
  3. copy .env.example to .env
  4. Set in .env file: WORKSPACE_PUID=1001, WORKSPACE_PGID=1001
  5. docker compose up -d workspace
  6. docker exec -itu 1001 laradock-workspace-1 bash
  7. id

Activity

  1. Mahmoudz commented on May 26, 2026

    @Mahmoudz
    Member

    Fixed by #3693 (merged in 585621c). The workspace Dockerfile now passes -g ${PGID} to groupmod and -u ${PUID} to usermod on PHP 8.1+, so PUID/PGID env vars are respected. Please re-build your workspace container (docker compose build --no-cache workspace) and reopen if the issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions