I got a Permission Denied error when I put Laravel in Docker

https://qiita.com/ucan-lab/items/56c9dc3cf2e6762672f4

I was building a Docker environment by referring to this article ... Laravel

docker-compose exec app bash
composer create-project --prefer-dist "laravel/laravel=8.*" .

After putting in

http://127.0.0.1:10080/ When I accessed ...

The stream or file "/work/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

image.png

I was told Permission Denied ... Docker is somewhere.

solution

It's a matter of authority, so you can give it authority. It's the same as "If you don't have bread, you can eat sweets with butter" and "If you don't have the authority, you can type the chown command".

In a Docker container

docker-compose exec app bash

Enter with

chown www-data storage/ -R     

If you give permission with the chown command …………

image.png

It's done! !! !! !!

Recommended Posts

I got a Permission Denied error when I put Laravel in Docker
When I bcrypt with node + docker, I got an error
A story that got stuck with an error during migration in docker PHP laravel
Avoid Permission Denied that occurs when developing Laravel with Docker
Avoid Permission Denied that occurs when developing Laravel with Docker
I get an error when adding a dependency
I got an error when I ran rake routes.
When I pushed to Docker Hub, I got requested access to the resource is denied
I got a cannot resolve symbol in Android Studio
I got an error "undefined method` create'" in RSpec
I got an "ActionView :: Template :: Error: Permission denied" error in the test of 3.3.1 of Rails tutorial 6th edition, so I solved it.
What I learned when building a server in Java
I have a question. I get an error when playing a video in Listview on android.
I got stuck in a clone of a two-dimensional array
I got an error when trying to install sbt to build a Scala development environment
When I switched to IntelliJ, I got a lot of differences in the encoding of the properties file.
[Docker] When I did docker-compose build, I got an error saying Can not read file. .. [Rails 6.0]
I got an error when using nextInt, nextLine and substring.
Resolve CreateProcess error = 206 when running Java in a Windows environment
I got stuck in File
What to do if you get a gcc error in Docker
When I try to put centos in VMware, pane is dead
I get a 404 error when testing forms authentication with Spring Security
Collecting client information when an error occurs in a web application
I get a Ruby version error when I try to start Rails.
[Environment construction] Error when bundle install Errno :: EACCES: Permission denied @ dir_s_mkdir-
I got stuck trying to write a where in clause in ActiveRecord
I tried to build a laravel operating environment while remembering Docker
What I checked when I installed Docker Hub in a Windows 10 home environment but it did not start
I created a PDF in Java.
General error: 1812 occurs with docker + laravel
Install laravel/Dusk in docker environment (laravel6)
I built a rails environment with docker and mysql, but I got stuck
When I ran a jar created using WildFly Swarm, I got an InvocationTargetException.
[JAVA] Project Euler, I got stuck in Q8, so make a note
[Visual Studio Code] I get a syntax error when debugging when using rbenv
I tried to build a Firebase application development environment with Docker in 2020
I want to display an error message when registering in the database
I had to lower the PHP version in Docker + Composer + Laravel environment
When registering a new user, I got an error called ActiveRecord :: NotNullViolation and how to deal with it.
In WSL2, when I did `docker-compose up`, I got an error saying that the sh file was not found.