The story when the container does not start up with docker-compose up and an error occurs

I was able to use it until the day before, but one day suddenly docker did not start up. (Is it because I updated my PC ??)

The first error I got was something like this

 Could not find ancestry-3.1.0 in any of the sources
 Run `bundle install` to install missing gems.

The above gem is listed in gemfile.lock, and I thought it was strange that an error would occur, but I tried docker-compose run web bundle install, but it didn't work with the same error as expected.

When I searched, there was an article like this. https://teratail.com/questions/291124 When I try docker-compose build --no-cache, the following error is displayed

db uses an image, skipping
Building web
Traceback (most recent call last):
  File "site-packages\docker\utils\build.py", line 96, in create_archive
OSError: [Errno 22] Invalid argument: '\\Directory name\\\ App name\\node_modules\\.bin\\acorn'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose\cli\main.py", line 67, in main
  File "compose\cli\main.py", line 126, in perform_command
  File "compose\cli\main.py", line 302, in build
  File "compose\project.py", line 468, in build
  File "compose\project.py", line 450, in build_service
  File "compose\service.py", line 1125, in build
  File "site-packages\docker\api\build.py", line 160, in build
  File "site-packages\docker\utils\build.py", line 31, in tar
  File "site-packages\docker\utils\build.py", line 100, in create_archive
OSError: Can not read file in context: \\?\Directory name\app name\node_modules\.bin\acorn
[24060] Failed to execute script docker-compose

After investigating with the above error, I arrived at this article. https://crieit.net/posts/docker-compose-build-Can-not-read-file As described, if you create .dockerignore and write node_modules, docker-compose build will work!

When I searched for an error, I also found an article about a docker version problem, but it seemed to be different from my version, so the mystery deepened ... I'm glad I solved it safely. https://github.com/docker/compose/issues/5888

The version where the error occurred this time

docker-compose version 1.27.4, build 40524192
Docker version Version:  19.03.13

Recommended Posts

The story when the container does not start up with docker-compose up and an error occurs
Container does not start with docker-compose
What I did when the DB did not start with docker-compose up
The story that led to solving the error because postgres did not start with docker-compose up
When the server does not start with rails s
[Docker] The story that an error occurred in docker-compose up
If the DB container does not start with Initializing database files
[NetBeans] Story when it does not start
[Grails] Error occurred running What to do when the Grails CLI does not start
Send an email when an ERROR level log occurs with the logback SMTP Appender
In WSL2, when I did `docker-compose up`, I got an error saying that the sh file was not found.
Docker Compose does not start with docker.credentials.errors.InitializationError error message
Customize the display when an error such as 404 Not Found occurs in Spring Boot
When an error occurs even though validation is not set
A story stuck with an error when building Vagrant + Virtulbox CentOS7.8 and creating a shared folder
[Note] How to restart the Windows container set up with docker-compose
The story that the build error did not stop when using Eclipse 2020
What to do and how to install when an error occurs in DXRuby 1.4.7
Specify the favorite IP of the host network with docker-compose and start it
docker-compose Rebuild and start Only one container
Recreate the container and then start it
MySQL container does not start in Docker
A reminder when an aapt.exe error occurs
[Ruby On Rails] When a model unit test is performed with RSpec using FactoryBot, an error occurs because the foreign key is not entered.
The story of an Illegal State Exception in Jetty.
[Docker] The story that an error occurred in docker-compose up
If the JDK version is correct in Eclipse but an error occurs or the compiler does not work properly
When I renew the certificate with CircleCI × fastlane, I get an exit status: 65 error.
[Error resolution] Occurs when trying to build an environment for spring with docker
What to do when is invalid because it does not start with a'-'
When using a list in Java, java.awt.List comes out and an error occurs
docker-compose up How to stop and restart Docker when a run-time error occurs [Cannot start service database: driver failed programming external connectivity on endpoint]
Let's create a TODO application in Java 12 Processing when a request comes in with an unused HttpMethod ・ Processing when an error occurs in the server
Does not recognize the library when implementing jcaptcha
Processing when an ID that does not exist in the database is entered in the URL
About the "Oops VFS connection does not exist" error and solution in AWS Cloud9
What to do if the JSONHint annotation does not work with lombok and JSONIC
Docker for Windows: MySQL container does not start when migrating from Hyper-v to WSL2
Localhost3000 does not start up in Docker / Rails development.
When I bcrypt with node + docker, I got an error
[Docker] When I did docker-compose build, I got an error saying Can not read file. .. [Rails 6.0]
The story of pushing a Docker container to GitHub Package Registry and Docker Hub with GitHub Actions
A story that ended up taking a break when using the Linked List with a light feeling
(Fixed) An error occurs when using Java 8 with the latest version (0.65.0) of Language Support for Java (TM) by Red Hat of VS Code.