我試圖設置我的elixir-phoenix應用程序與postgresql數據庫與Docker運行。這是我的Dockerfile樣子:Docker錯誤:standard_init_linux.go:185:exec用戶進程導致「沒有這樣的文件或目錄」
# ./Dockerfile
# Starting from the official Elixir 1.5.2 image:
# https://hub.docker.com/_/elixir/
FROM elixir:1.5.2
ENV DEBIAN_FRONTEND=noninteractive
# Install hex
RUN mix local.hex
# Install rebar
RUN mix local.rebar
# Install the Phoenix framework itself
RUN mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez
# Install NodeJS 6.x and the NPM
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get install -y -q nodejs
# Set /lib as workdir
WORKDIR /lib
這是我的搬運工,compose.yml文件:
web:
build: .
dockerfile: Dockerfile
env_file: .env
command: mix phx.server # Start the server if no other command is specified
environment:
- MIX_ENV=dev
- PORT=4000
- PG_HOST=postgres
- PG_USERNAME=postgres
volumes:
- .:/lib
ports:
- "4000:4000"
links:
- postgres
test:
image: phoenixbootstrap_web
env_file: .env
command: mix test
environment:
- MIX_ENV=test
- PORT=4001
- PG_HOST=postgres
- PG_USERNAME=postgres
volumes_from:
- web
links:
- postgres
postgres:
image: postgres:10.0
ports:
- "5432"
圖像成功建立,但是當我嘗試使用以下命令安裝依賴:
docker-compose run web mix do deps.get
我得到這些錯誤:
standard_init_linux.go:185: exec user process caused "no such file or directory"
PS:我發現了幾個答案,如this one,指出在bash文件開頭缺少一行,但它似乎不是我的情況。我沒有運行bash腳本,而我的錯誤出現在第185行,而不是179.
http://willi.am/blog/2016/08/11/docker-for-windows-dealing-with-windows-line-endings/ – Righto