ecrを使ってCircle CIの自動デプロイを実装しようとしたのですが、nginx・railsのbuild時にそれぞれエラーがでます。
nginxの場合
Step 2/4 : RUN rm -f /etc/nginx/conf.d/* ---> Running in fc2b4d4e1449 ---> 17e61923e810 Removing intermediate container fc2b4d4e1449 Step 3/4 : ADD nginx.conf /etc/nginx/conf.d/my_song.conf ADD failed: stat /var/lib/docker/tmp/docker-builder404643319/nginx.conf: no such file or directory
railsの場合
#!/bin/bash -eo pipefail docker build -f Dockerfile -t $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/mysong_web:latest -t $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/mysong_web:$CIRCLE_SHA1 . docker push $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/mysong_web:$CIRCLE_SHA1 unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/circleci/project/Dockerfile: no such file or directory
railsのエラーはディレクトの指定ミスかなと思ったのですが、
railsのDockfileはプロジェクトファイルの直下にあるので、間違ってないです。
nginxのDockerfile
FROM nginx:1.15.8 RUN rm -f /etc/nginx/conf.d/* # Nginxの設定ファイルをコンテナにコピー ADD nginx.conf /etc/nginx/conf.d/my_song.conf #Nginx起動 CMD /usr/sbin/nginx -g 'daemon off;' -c /etc/nginx/nginx.conf
Circle CIのconfig.ymlです。(一部抜粋)
- run: name: "nginx push" command: | docker build -f ./containers/nginx/Dockerfile -t $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/mysong_server:latest -t $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/mysong_server:$CIRCLE_SHA1 . docker push $AWS_ACCOUNT_ID.dkr.ecr.ap-northea - run: name: "rails push" command: | docker build -f ./Dockerfile -t $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/mysong_web:latest -t $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/mysong_web:$CIRCLE_SHA1 . docker push $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/mysong_web:$CIRCLE_SHA1st-1.amazonaws.com/mysong_server:$CIRCLE_SHA1
回答よろしくお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。