ドキュメントに沿ってrailsを立ち上げようとしているけど、no such file or directory
のエラーが
対象のドキュメント
事象
上記のドキュメントに沿って、下記の状態まで順々に設定
➜ sample ls Dockerfile Gemfile Gemfile.lock docker-compose.yml
このコマンドでエラーが発生。
ファイルがないと言われているのはわかっているのですが、対処の方法がわからず。。。
docker-compose run web rails new . --force --no-deps --database=postgresql
エラー
---> 18ecc04bdd8f Step 8/13 : COPY . /myapp ---> Using cache ---> b0183684be2a Step 9/13 : COPY entrypoint.sh /usr/bin/ ERROR: Service 'web' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder990953367/entrypoint.sh: no such file or directory
どなたかご教示いただけないでしょうか。
URLは https://teratail.com/help/question-tips#questionTips3-7 の [リンク] で [リンク先の概要](http...) に修正してください。
Dockerfileおよびdocker-compose.ymlの内容を追記してください。記載ミスを疑っています。
中身はこちらです。
```
➜ sample cat Dockerfile
FROM ruby:2.5
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
RUN mkdir /myapp
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
COPY . /myapp
# Add a script to be executed every time the container starts.
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 3000
# Start the main process.
CMD ["rails", "server", "-b", "0.0.0.0"]
➜ sample cat docker-compose.yml
version: '3'
services:
db:
image: postgres
volumes:
- ./tmp/db:/var/lib/postgresql/data
web:
build: .
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- .:/myapp
ports:
- "3000:3000"
depends_on:
- db
```
>Dockerfileおよびdocker-compose.ymlの内容を追記してください。
ここ[質問への追記・修正、ベストアンサー選択の依頼]を読んでくれる人は少ないので、質問に追記した方が読んでくれる人が増え易いかと。
回答2件
あなたの回答
tips
プレビュー