Docker Compose raise an AccessDeniedExpcetion

I’m trying to compose the ELK architecture by using docker compose. The following is the compose file:

version: '2'

services:

  elasticsearch_assets:
    image: elasticsearch
    volumes:
      - ./elasticsearch/config:/usr/share/elasticsearch/config
      - ./elasticsearch/data:/usr/share/elasticsearch/data
      - ./elasticsearch/logs:/usr/share/elasticsearch/logs
    command: /bin/true

  elasticsearch:
    image: elasticsearch
    volumes_from:
      - elasticsearch_assets:rw
    depends_on:
      - elasticsearch_assets

And here folliwing a screenshot of the project structure:

  • How to set busybox vi auto wrap when a line too long?
  • Running elasticsearch in docker
  • Port forwarding in docker-machine?
  • AWS ECS weird docker behavior
  • AWS Elastic Beanstalk Docker deployment failed
  • Letsencrypt + Docker + Nginx
  • enter image description here

    When I run docker-compose up I get the following error:

    Starting elkdocker_elasticsearch_assets_1
    Starting elkdocker_elasticsearch_1
    Attaching to elkdocker_elasticsearch_assets_1, elkdocker_elasticsearch_1
    elkdocker_elasticsearch_assets_1 exited with code 0
    elasticsearch_1        | [2016-03-22 01:28:59,939][WARN ][bootstrap                ] unable to install syscall filter: seccomp unavailable: your kernel is buggy and you should upgrade
    elasticsearch_1        | Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.scripts' (/usr/share/elasticsearch/config/scripts)
    elasticsearch_1        | Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/config/scripts
    elasticsearch_1        |    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
    elasticsearch_1        |    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    elasticsearch_1        |    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    elasticsearch_1        |    at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
    elasticsearch_1        |    at java.nio.file.Files.createDirectory(Files.java:674)
    elasticsearch_1        |    at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
    elasticsearch_1        |    at java.nio.file.Files.createDirectories(Files.java:767)
    elasticsearch_1        |    at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:337)
    elasticsearch_1        |    at org.elasticsearch.bootstrap.Security.addPath(Security.java:314)
    elasticsearch_1        |    at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:248)
    elasticsearch_1        |    at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:212)
    elasticsearch_1        |    at org.elasticsearch.bootstrap.Security.configure(Security.java:118)
    elasticsearch_1        |    at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:196)
    elasticsearch_1        |    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167)
    elasticsearch_1        |    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
    elasticsearch_1        |    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
    elasticsearch_1        | Refer to the log for complete error details.
    elkdocker_elasticsearch_1 exited with code 1
    

    Do you have any idea why?

  • How to use docker in a gitlab-ci job?
  • Docker build tag repository name
  • GC overhead limit exceeded in Docker when trying to build project by sbt
  • How to assign a host port to container port using docker if container is already created and running?
  • docker swarm certificate expiry
  • MySQL import hangs on Vagrant CoreOS box on Mac
  • One Solution collect form web for “Docker Compose raise an AccessDeniedExpcetion”

    regarding this error
    Unable to access ‘path.scripts’ error
    just create a sub folder called scripts under the config folder
    it will fix the error

    ./elasticsearch/config ==> mkdir ./elasticsearch/config/scripts

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