[Docker] When I did docker-compose build, I got an error saying Can not read file. .. [Rails 6.0]

Recently, a new project started with team development, and I did the task of environment construction with Docker. At that time, when I tried to build Docker, I was at a loss because I got an error that I had never seen, `ʻOSError: Can not read file in context ~ ``, so that there is no one to follow the same path. I will share it here.

【environment】

Solution

Suddenly, it's a solution. It's that easy. Apparently, when I was reading the error statement, the node_modules directory seemed to be bad, so I created a **. Doctorignore file ** and there I wrote node_modules and rebuilt it and it worked!

.dockerignore


node_modules

Impressions

Once you create Docker, you can reuse the environment, and in team development, if one person creates it, you can immediately reproduce the exact same environment, so it's insanely convenient! However, due to lack of knowledge, even if you build with another person's Dockerfile Maru Pakuri, it often does not work and you often struggle with errors ... It takes many times longer, isn't it?

Thank you for reading to the end!

If you have any suggestions or impressions, I would appreciate it if you could comment! !!

Recommended Posts

[Docker] When I did docker-compose build, I got an error saying Can not read file. .. [Rails 6.0]
In WSL2, when I did `docker-compose up`, I got an error saying that the sh file was not found.
When I did rails new, I got an error saying PG :: ConnectionBad: could not connect to server: No such file or directory
When I bcrypt with node + docker, I got an error
I got an error when I ran rake routes.
I got an error when trying to install sbt to build a Scala development environment
What I did when the DB did not start with docker-compose up
I got a Permission Denied error when I put Laravel in Docker
The story that the build error did not stop when using Eclipse 2020
When I tried to build an environment of PHP7.4 + Apache + MySQL with Docker, I got stuck [Windows & Mac]
[Error resolution] Occurs when trying to build an environment for spring with docker
What to do if you get an error saying "Could not find a JavaScript runtime." When starting rails server
Webdrivers :: BrowserNotFound: Failed to find Chrome binary. When I was trying to test E2E with Docker + Rails for the first time, I got stuck in an error.
I get an error when adding a dependency
[Mockito] 3.2.4 → 3.3.x, but I got an error (Iketenai)
[Rails] How to build an environment with Docker
The story when the container does not start up with docker-compose up and an error occurs