マイクロソフト Learnサイトに掲載されている文書を読んで実行したら、どうもうまく行かないときのメモです。
URL:
https://learn.microsoft.com/en-us/azure/app-service/tutorial-java-tomcat-mysql-app
レポジトリ:https://github.com/Azure-Samples/msdocs-tomcat-mysql-sample-app
- Run the sample
Step 2: In the GitHub fork:
Select main > starter-no-infra for the starter branch. This branch contains just the sample project and no Azure-related files or configuration.
Select Code > Create codespace on starter-no-infra. The codespace takes a few minutes to set up.
コンテナの構築時、エラー発生。Java (with SDKMAN)インストール失敗 と怒られました。
GitHubのcodespaceはサンドボックス的な環境で、 sudo apt installは通用しません。
試行錯誤の結果:
.devcontainer\devcontainer.json
features : { の ghcr.io/devcontainers/features/java:1" : {
に "mavenVersion" : "3.8.6"を付け加えると、エラーが解消されました。
修正前:
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "none",
"installMaven": "true",
"installGradle": "false"
},
"ghcr.io/azure/azure-dev/azd:latest": {},
"ghcr.io/devcontainers/features/azure-cli:1": {}
},
修正後:
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "none",
"installMaven": "true",
"mavenVersion" : "3.8.6",
"installGradle": "false"
},
"ghcr.io/azure/azure-dev/azd:latest": {},
"ghcr.io/devcontainers/features/azure-cli:1": {}
},
以上です。