Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change vendor owner ? #61

Closed
WarGot-by opened this issue Oct 9, 2018 · 2 comments
Closed

How to change vendor owner ? #61

WarGot-by opened this issue Oct 9, 2018 · 2 comments

Comments

@WarGot-by
Copy link

I using docker-compose to manage containers. When I run composer install in the vendor directory, all subfolders are created with the root owner. I can't delete them after that. How do I create folders under another user ?
`
version: '3'

services:

composer:

    container_name: composer

    build:

        context: ./docker/etc/composer

        dockerfile: Dockerfile

    volumes:

      - "./:/app"

    command: composer install

`

@jakzal
Copy link

jakzal commented Oct 9, 2018

Have you tried running the container with a non-root user? It's mentioned in the docs.

In docker-composer.yml you'd need to do sth like:

composer:
    # ...
    user: ${CURRENT_UID}

You'll need to then export the CURRENT_UID environment variable so it's known to docker-compose. For example: CURRENT_UID=$(id -u):$(id -g) docker-compose up -d.

@alcohol
Copy link
Member

alcohol commented Oct 10, 2018

You could also run

docker-compose run -u $(id -u) composer install

@alcohol alcohol closed this as completed Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants