2017-10-09 8 views
13

Dockerで動作するようにpostgresqlデータベースでelixir-phoenixアプリケーションを設定しようとしています。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" 

画像が正常にビルドが、私は次のコマンドで依存関係をインストールしようとすると、これは私のDockerfileは、次のようになります:

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スクリプトを実行せず、エラーは179ではなく185行目に表示されます。

+0

http://willi.am/blog/2016/08/11/docker-for-windows-dealing-with-windows-line-endings/ – Righto

答えて

8

上記のように、bashファイルには、先頭に#!/bin/bashがないことが考えられます。

ファイルがWindowsの行末(CRLF)で保存されている可能性があります。 Unixの行末(LF)で保存してください。

+1

あなたは私の一日を保存しました。私はgit config core.autocrlf = true(ファイルはWindowsの行末(CRLF)で保存されていました)を使っていましたが、それがドッカーと干渉できるとは考えていませんでした。本当にありがとうございます – vladkha

+1

人生保護人-http://willi.am/blog/2016/08/11/docker-for-windows-dealing-with-windows-line-endings/ – Righto

関連する問題