0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

初めてのGitHubActionsへのデプロイでつまずいた話 ~Gradleを添えて~

Posted at

UdemyでDockerの講座をハンズオンで進めていたらつまずきました。
基本コピペで進めていけばつまずくことはないはずなのに...

どこでつまずいたのか

簡単なwebアプリを作成し、GitHubActionsにデプロイしてAWS上で動かすということをしていました。
ですが、GitHubActionsにデプロイするとなぜか失敗します。
ログを見るとAPIコンテナのBuildがうまくいっていない模様。

ERROR: failed to solve: process "/bin/sh -c ./gradlew build" did not complete successfully: exit code: 126

もう少し上の行をみたらこんな出力も...
./gradlew: Permission denied

ふ~ん、permission denied ね

どう解決したのか

APIコンテナをBuildするDockerfileを修正しました。
具体的には、

RUN ./gradlew build

というBuildを行うコマンドの実行前に、

RUN chmod +x ./gradlew

というコマンドを走らせました。

gradleの実行権限を追加するコマンドのようですね~
gradleの実行には権限が必要らしいよ

最後に

この記事が誰かの役に立てば幸いです

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?