Errno::EACCES creating rails project using Docker Rails image

I’m trying to use the official Rails image for Docker to create my development environment and after creating the container using docker build -t my-rails-app . I tried to bootstrap the new app using this command:

docker run -it --rm --user "$(id -u):$(id -g)" -v "$PWD":/usr/src/app -w /usr/src/app rails rails new --skip-bundle webapp

And got this error:

  • How to enable MongoDB access control using a Docker container?
  • Making the windows docker commands to be linked to a remote linux machine docker daemon
  • Docker Compose Expose Spark Worker UI Ports Dynamically to Host When Scaling
  • Docker exec runs command on host machine instead of container
  • Remote access to webserver in docker container
  • Passing environment variables to Docker containers
  •       create
    /usr/locfrom /usr/local/lib/ruby/2.3.0/fileutils.rb:253:in `fu_mkdir'ied @ dir_s_mkdir - /usr/src/app/webapp (Errno::EAC
    CES)    from /usr/local/lib/ruby/2.3.0/fileutils.rb:227:in `block (2 levels) in mkdir_p'
            from /usr/local/lib/ruby/2.3.0/fileutils.rb:225:in `block in mkdir_p'
            from /usr/local/lib/ruby/2.3.0/fileutils.rb:211:in `mkdir_p'
            from /usr/local/bundle/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:116:in `invoke_with_conflict_check'
            from /usr/local/bundle/gems/thor-0.19.1/lib/thor/actions.rb:94:in `action'b:49:in `invoke!'
            from /usr/local/bundle/gems/railties-4.2.6/lib/rails/generators/app_base.rb:138:in `create_root'ry'
            from /usr/local/bundle/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
            from /usr/local/bundle/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
            from /usr/local/bundle/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map''
            from /usr/local/bundle/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'ke_all'
            from /usr/local/bundle/gems/railties-4.2.6/lib/rails/commands/application.rb:17:in `<top (required)>'
            from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
            from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
            from /usr/local/bundle/gems/railties-4.2.6/bin/rails:9:in `<top (required)>':55:in `require'
            from /usr/local/bundle/bin/rails:22:in `<main>'

    How can I solve this?

  • Understanding a simple dockerfile of postgresql
  • How to use the rabbitmq docker compose yml file to build docker image?
  • Use RubyMine and Docker for development
  • Docker container access to local DNS
  • What does “attach to standard streams” mean in docker?
  • Docker for Mac. docker run -d -p 80:80 --name webserver nginx shows another container with this name. but docker ps shows empty list
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.