Skip to content

Docker for Windows - Container permissions issue #7928

@jawa-the-hutt

Description

@jawa-the-hutt
Description

I'm doing my development in VS Code on Windows and have ran into what I think is a permissions issue in the container that is specific to an ongoing issue with Docker for Windows: docker/for-win#497 combined with a pull request here: #5702 that changed the user running the container.

In Docker for Windows, if a drive is mounted and the container is not run as root, then the user running the container has permission issues with the mount. In this case, when I run ./run-in-docker.sh mvn package, it causes a folder to show up in VS Code that is a named 

capture

Because this folder shows up, Git tries to add it in unless I specifically add  to .gitignore.

Swagger-codegen version

2.4.0

Command line used for generation

./run-in-docker.sh mvn package

Steps to reproduce
  1. Run Docker for Windows
  2. Use VS Code
  3. run ./run-in-docker.sh mvn package
  4. Special character named folder may show up.
Suggest a fix/enhancement

Not sure on a fix/enhancement exactly. I can workaround the issue by doing something like this in the windows command line.

docker.exe run --rm -it -w /gen -e GEN_DIR=/gen -e MAVEN_CONFIG=/var/maven/.m2 -v "${PWD}:/gen" -v "${HOME}/.m2/repository:/var/maven/.m2/repository" --entrypoint "/gen/docker-entrypoint.sh" maven:3-jdk-7 mvn package

as you can see, i'm basically mimicking run-in-docker.sh but i'm eliminating -u "$(id -u):$(id -g)" and the container will essentially run as root.

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