In WSL2, when I did `docker-compose up`, I got an error saying that the sh file was not found.

environment

procedure

docker-compose.yml


services:
  rails:
    <<: *app_base
    shm_size: 2G
    command: bin/start_dev_server.sh

So I did docker-compose up.

error contents

ERROR: for rails  Cannot start service rails: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"bin/start_dev_server.sh\": stat bin/start_dev_serversh: no such file or directory": unknown

I got the error "sh file is missing / unknown".

Cause

In WSL2, the absolute path of mnt / c is applied, In the Docker for Windows VM, the absolute path of c is applied, so it seems that the root path was different in the first place.

For more information, see Docker-compose and incorrect absolute paths for volumes

solution

$ sudo mkdir /c
$ sudo mount --bind /mnt/c /c
$ cd /c/path/to/project
$ docker-compose ...

Mount files under Windows (/ mnt / c) on Ubuntu

Recommended Posts

In WSL2, when I did `docker-compose up`, I got an error saying that the sh file was not found.
[Docker] When I did docker-compose build, I got an error saying Can not read file. .. [Rails 6.0]
[Docker] The story that an error occurred in docker-compose up
When I did rails new, I got an error saying PG :: ConnectionBad: could not connect to server: No such file or directory
The story when the container does not start up with docker-compose up and an error occurs
Customize the display when an error such as 404 Not Found occurs in Spring Boot
When I think about the 402 error that suddenly appeared in the middle of the introduction of PAY.jp, there was an unexpected place
[RSpec] When I tested the view file that used the helper method, I got ActionView :: Template :: Error :. ..
[Gradle] The story that the class file did not exist in the jar file
Symbol not found error when new class in another Java file
The story that the build error did not stop when using Eclipse 2020
I want to display an error message when registering in the database
What I did when I was addicted to the error "Could not find XXX in any of the sources" when I added a Gem and built it
When I run the source command in the Ubuntu Makefile, it says "source: command not found"
Command that the registered information was not found
I got an error when I ran rake routes.
I want you to put the story that the error was solved when you stabbed the charger in the corner of your head
Processing when an ID that does not exist in the database is entered in the URL
[Summary] What I noticed and did when I was told that the Oracle JDK was paid
The story that did not disappear when I tried to delete mysql on ubuntu
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 got an error "undefined method` create'" in RSpec
When I bcrypt with node + docker, I got an error
[JUnit] I suddenly got an initialization Error in the JUnit test that worked normally until the day before; background and solution memorandum
When I switched to IntelliJ, I got a lot of differences in the encoding of the properties file.
When I run docker-compose exec in crontab, I get "the input device is not a TTY"
I found no way to get the error code when I received an exception on Android
I got an error when using nextInt, nextLine and substring.
The story when the test folder was not created in Rails
The story I was addicted to when setting up STS
I got stuck in File
PG :: ConnectionBad: could not connect to server: No such file or directory
When I did rails new, I got an error saying PG :: ConnectionBad: could not connect to server: No such file or directory
Solved the problem that the scroll event did not fire in JQuery
About what I did when creating a .clj file in Clojure
I got a Permission Denied error when I put Laravel in Docker
I don't see an error in Rails bundle install ... the solution
I got a good punch when trying Hello World in Scala (object java.lang.Object in compiler mirror not found.)