Skip to content

Missing write permissions for "docker" home directory #256

@mbrodala

Description

@mbrodala

Expected Behavior

Commands can write to the home directory of docker (~, /home/docker), e.g. ~/.cache.

Current Behavior

There are permission errors, .e.g in Yarn:

yarn run v1.22.5
warning Skipping preferred cache folder "/home/docker/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1001".

Possible Solution

Update the owner ID of /home/docker in the image entrypoint.

Steps to Reproduce (for bugs)

  1. Have a host user with an ID different from 1000
  2. Start a container, e.g. PHP-FPM
  3. Run a command or interactive shell
  4. Try to write to /home/docker

Context

I noticed this with a Yarn installation.

The owner of /home/docker is left at 1000:

$ ls -ld ~
drwxr-xr-x 1 1000 docker 4096 Apr 11 06:00 /home/docker

However, the ID of the docker user was updated to reflect my host user:

$ id
uid=1001(docker) gid=1000(docker) groups=1000(docker),27(sudo)

Your Environment

  • Version used: thecodingmachine/php:8.0-v4-fpm-node14
  • Operating System and version:
    Distributor ID:	Debian
    Description:	Debian GNU/Linux 11 (bullseye)
    Release:	11
    Codename:	bullseye
    
  • Link to your project: private

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleIssues inactives for a while (automatically)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions