1

I have the following Dockerfile:

FROM ruby:2.3.3
ENV "GEM_HOME" "/home/gems"
ENV "BUNDLE_PATH" "/home/gems"
EXPOSE 3000
WORKDIR /home/webapp
CMD ["/home/webapp/startup.sh"]

The startup.sh file looks like this:

#!/bin/sh
bundle install
bundle exec rails server puma -b 0.0.0.0 -e production

With this Dockerfile I build an image on Docker Hub. I choose this image in the Azure Linux App Service Website Docker Container settings. No problems here.

Via FTP I upload my Rails app (is in folder webapp, this folder contains the startup.sh file) in the / folder of the Linux App Service. According to a comment on this page: https://learn.microsoft.com/en-us/azure/app-service-web/app-service-linux-how-to-create-a-web-app the / of the App Service is mapped to /home in the container.

However my webapp won't show if I access it via the browser. In

/LogFiles/docker/docker_***_err.log

it says:

standard_init_linux.go:178: exec user process caused "no such file or directory"

What I am trying to achieve is that my app data and gems are outside the container image. I tested the image successfully on my local mac with:

docker run -it -p 8888:3000 -v /Users/***/Desktop/ms:/home xyz/rubyimage

The ms folder contains the folder webapp.

user2415476
  • 211
  • 1
  • 15
  • I changed the last line in the Dockerfile to: CMD bundle install && bundle exec rails server puma -b 0.0.0.0 -e production. This works, however I still don't know why the .sh file can't be executed or is not found. – user2415476 Feb 15 '17 at 19:30
  • I commented on http://stackoverflow.com/questions/42258695/azure-linux-app-service-just-start-one-container. – nlawalker Feb 27 '17 at 23:31

2 Answers2

2

My guess is that the #!/bin/sh in the start.sh causes the trouble. Try putting #!/bin/bash there.

Source: https://forums.docker.com/t/getting-panic-spanic-standard-init-linux-go-178-exec-user-process-caused-no-such-file-or-directory-red-while-running-the-docker-image/27318/4

Timlukas B.
  • 31
  • 1
  • 5
0

I had this issue on a windows machine, it was because of the line endings on the first line in my "entrypoint.sh" file:

#!/bin/bash

I'm using Visual Studio Code, and fixed by changing the line ending from "CRLF" to "LF":

Visual Studio Code: How to show line endings

Marty
  • 1,182
  • 2
  • 13
  • 22