DEV Community

Discussion on: Specifying user and group in Docker

Collapse
 
devnix profile image
Dev_NIX • Edited

You can also provide a default value, and override it with the environment variable or with a docker-compose.override.yml:

web:
  build: 
    context: docker/web
    args:
      uuid: ${CURRENT_UID:-1000}

And then in your Dockerfile:

RUN usermod -u $uuid www-data
Collapse
 
acro5piano profile image
Kay Gosho

Thank you for the information!