我一直在学习如何运行多容器应用程序的教程。
https://learn.microsoft.com/de-de/azure/container-instances/tutorial-docker-compose
我已经为我要部署的应用程序创建了一个资源组(称为“我的资源组”)。如您所见,它与其他资源组一起存在。
C:\dev\shape-shop-back-end>az group list
[
{
"id": "/subscriptions/8cdb50cb-ede8-4eac-80df-55afadf861cd/resourceGroups/cloud-shell-storage-westeurope",
"location": "westeurope",
"managedBy": null,
"name": "cloud-shell-storage-westeurope",
"properties": {
"provisioningState": "Succeeded"
},
"tags": null,
"type": "Microsoft.Resources/resourceGroups"
},
{
"id": "/subscriptions/8cdb50cb-ede8-4eac-80df-55afadf861cd/resourceGroups/shapeShopResourceGroup",
"location": "eastus",
"managedBy": null,
"name": "shapeShopResourceGroup",
"properties": {
"provisioningState": "Succeeded"
},
"tags": null,
"name": "myResourceGroup",
"properties": {
"provisioningState": "Succeeded"
},
"tags": null,
"type": "Microsoft.Resources/resourceGroups"
}
]
现在,当我运行docker compose up时,我得到以下错误:
C:\dev\shape-shop-back-end>docker compose up
[+] Running 0/1
- Group shape-shop-back-end Error 0.6s
containerinstance.ContainerGroupsClient#CreateOrUpdate: Failure sending request: StatusCode=404 -- Original Error: Code="ResourceGroupNotFound" Message="Resource group '720e631e-ce87-88e3-0cec-ca01ad4f3411' could not be found."
这对我来说似乎很不寻常,因为在我的列表中,我没有名为720 e631-blahblahblah的资源组。
让我困惑的是,docker compose如何知道要部署到哪个资源组?在我的docker compose yaml文件中没有任何指示资源组的内容。
有没有像默认资源组这样的东西?如果我可以有很多资源组,那么我怎么知道docker compose指向的是哪个资源组呢?
这里值得一提的是我的docker-compose.yml文件。
version: '3.7'
services:
app-server:
image: ollyw123/shapeshop
ports:
- "8080:8080"
depends_on:
- db
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://db:3306/shapeshop?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: root
SERVER_PORT: 8080 # must match with ports
networks:
- backend
db:
image: mysql:5.7
ports:
- "3306:3306"
restart: always
environment:
MYSQL_DATABASE: shapeshop
MYSQL_USER: admin
MYSQL_PASSWORD: admin
MYSQL_ROOT_PASSWORD: root
networks:
- backend
volumes:
db-data2:
networks:
backend:
1条答案
按热度按时间7lrncoxx1#
您在运行以下命令时选择了资源组:
文件