Skip to content
This repository was archived by the owner on May 27, 2026. It is now read-only.
This repository was archived by the owner on May 27, 2026. It is now read-only.

Ability to change owner of com.docker.devenvironments.code #119

Open

Description

@joezappie

Tell us about your request
I'm still fairly new to Docker so there might be a way around this but everything I've tried has not worked. My issue is that when opening my container in VS Code and the files are mounted in /com.docker.devenvironments.code, the owner of that is not root which causes some issues for my development environment. I think it should mount as the user of the container - in compose if "user: root" is set, then the volume should be mounted as root.

drwxr-xr-x  14 node node 4096 Jun 12 22:35 com.docker.devenvironments.code

Which service(s) is this request for?
Docker Desktop Development Enviroment

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
My project uses the node:16 image so for some reason that volume gets mounted with node being owner and group for all files.

I tried overriding it in my docker-compose.yaml file but that didnt help:

 app:
    build:
      context: .
      dockerfile: Dockerfile.dev
    user: root
    ports:
      - 80:80

I also tried setting "USER root" in my Dockerfile.dev.

My Dockerfile.dev puts all my src files in /usr/src/app and inspecting that, they are all owned by root. When that then gets mounted, it changes it node and also my node_modules folder weirdly also isnt copied over.

Are you currently working around the issue?
Only workaround I know of is to in the CLI manually change the ownership of the folder recursively:

chown root -R /com.docker.devenvironments.code
chgrp root -R /com.docker.devenvironments.code

This then lets me "npm install" to get back the node_modules folder (which some modules require node_module to be owned by the user installing it).

Clearly not ideal as this is a step every developer needs to take after checking out a branch or if they need to wipe and restart.

Additional Info
Its not clear to me how its even picking to use the user "node".

Activity

  1. phatpaul commented on Oct 27, 2022

    @phatpaul

    I came here to say this after giving Dev Environments a try.

    I got as far as npm install but it failed to install sharp with an error that the owner of the folder should be the same as the user running npm install.

    Any tips?

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions