how could I add user permission parameter into docker-compose

I want to adapt this command into docker-compose.yml

docker run -d -v /Users/eric/workspace/apache-spark-playground/es_datastore:/usr/share/elasticsearch/data --user 1000:50 elasticsearch:2.1.1

  • Docker port mapping not working
  • how to make docker bypass the page cache in Mac OS
  • File permissions for mapped folders on host machine
  • App running in Docker on EB refuses connecting to self
  • Dockerfile COPY {source-…}
  • connecting to services on docker host from docker container
  • How should I modify the following yaml sample

    elasticsearch:
      image: elasticsearch:2.1.1
      hostname: elasticsearch
      ports:
        - "9200:9200"
      volumes:
        - ./es_datastore:/usr/share/elasticsearch/data
    

  • Permission Issue with Docker Volume Driver for Azure File Storage
  • docker exec command not executing in sh file
  • How to move docker installation to another machine?
  • getting error /bin/sh: 1: source: not found
  • Docker with nodeBB redis is not configured properly?
  • Dial tcp i/o timeout with Docker in Gitlab CI build
  • One Solution collect form web for “how could I add user permission parameter into docker-compose”

    According to the docker-compose docs this should work:

    user: 1000:50
    

    source

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.