我试图使用YAML文件和命令运行一个容器,以运行映像:
command: [
"/bin/bash",
"-c",
"python /home/indy/.pyenv/versions/3.6.9/bin/aca-py start -it http 0.0.0.0 10000 -ot http --admin 0.0.0.0 5000 --wallet-type indy --seed 10000000000000000000111111111110 --label Axis Test --admin-insecure-mode --log-level debug --wallet-storage-type postgres_storage --wallet-name test2 --wallet-storage-config "{\"url\":\"xx.xx.xxx.xxx:5432\",\"wallet_scheme\":\"DatabasePerWallet\"}" --wallet-storage-creds "{\"account\":\"xxxxxx\",\"password\":\"xxxxxxx\",\"admin_account\":\"postgres\",\"admin_password\":\"xxxxxxxxx\"}"",
]我收到了这个错误
解析yaml文件时
错误:在"axis.yaml“中解析流序列时,第9行第16列期望',‘或’],但在"axis.yaml”中得到'{‘,第12行,第331列

钱包-存储-配置需要传入双引号,其他明智的,它会显示错误时,运行图像作为它的Expecting property name enclosed in double quotes。如果我用命令中的单引号替换双引号,则容器在没有日志时失败。
command: [
'/bin/bash',
'-c',
'python /home/indy/.pyenv/versions/3.6.9/bin/aca-py start -it http 0.0.0.0 10000 -ot http --admin 0.0.0.0 5000 --wallet-type indy --seed 10000test00000000000111111111110 --label Axis Test --admin-insecure-mode --log-level debug --wallet-storage-type postgres_storage --wallet-name test2 --wallet-storage-config "{\"url\":\"xx.xx.xxx.xxx:5432\",\"wallet_scheme\":\"DatabasePerWallet\"}" --wallet-storage-creds "{\"account\":\"xxxxxx\",\"password\":\"xxxxxx\",\"admin_account\":\"postgres\",\"admin_password\":\"xxxxxxx\"}"',
]api-version: 2019-12-01
location: eastus
name: testcontainer
properties:
containers:
- name: ariesagent
properties:
image: bcgovimages/aries-cloudagent:py36-1.14-1_0.5.1
command: [
"/bin/bash",
"-c",
"python /home/indy/.pyenv/versions/3.6.9/bin/aca-py start -it http 0.0.0.0 10000 -ot http --admin 0.0.0.0 5000 --wallet-type indy --seed 10000000000000000000111111111110 --label 'Axis Test' --admin-insecure-mode --log-level debug --wallet-storage-type postgres_storage --wallet-name test2 --wallet-storage-config "{\"url\":\"xx.xx.xxx.xxx:5432\",\"wallet_scheme\":\"DatabasePerWallet\"}" --wallet-storage-creds "{\"account\":\"xxxxxx\",\"password\":\"xxxxxx\",\"admin_account\":\"postgres\",\"admin_password\":\"xxxxxx\"}"",
]
ports:
- port: 5000
protocol: TCP
- port: 10000
protocol: TCP
resources:
requests:
cpu: 1.0
memoryInGB: 1.5
ipAddress:
ports:
- port: 5000
protocol: TCP
- port: 10000
protocol: TCP
type: Public
dnsNameLabel: testcontainer-axis
osType: Linux
tags: null
type: Microsoft.ContainerInstance/containerGroups码头运行命令
docker run -d -p 5001:5000 -p 10001:10000 --name postgrearies1 bcgovimages/aries-cloudagent:py36-1.14-1_0.5.1 start -it http 0.0.0.0 10000 -ot http --admin 0.0.0.0 5000 --admin-insecure-mode --seed 10000000000000000000111111111110 --wallet-type indy --log-level debug --storage-type indy --wallet-storage-type postgres_storage --wallet-name test2 --wallet-storage-config "{\"url\":\"xx.xx.xxx.xxx:5432\",\"wallet_scheme\":\"DatabasePerWallet\"}" --wallet-storage-creds "{\"account\":\"xxx\",\"password\":\"xxxx\",\"admin_account\":\"postgres\",\"admin_password\":\"xxxxx\"}"发布于 2020-12-16 10:57:15
我能够通过在命令中作为env传递所需的值来解决这个问题。
command: [
"/bin/bash",
"-c",
"python /home/indy/.pyenv/versions/3.6.9/bin/aca-py start -it http 0.0.0.0 10000 -ot http --admin 0.0.0.0 5000 --wallet-type indy --seed 10000000000000000000111111111110 --label ${AGENT_NAME} --admin-insecure-mode --log-level debug --wallet-storage-type postgres_storage --wallet-name newwallet --wallet-storage-config ${WALLET_CONFIG} --wallet-storage-creds ${WALLET_CRED}",
] 而不是传递那些环境变量
environmentVariables:
- name: AGENT_NAME
value: xxxxxx
- name: WALLET_CONFIG
value: "{\"url\":\"xxxxx.xxxxzurecontainer.io:5432\",\"wallet_scheme\":\"DatabasePerWallet\"}"
- name: WALLET_CRED
value: "{\"account\":\"xxxxx\",\"password\":\"xxxxx\",\"admin_account\":\"postgres\",\"admin_password\":\"xxxxxx\"}" https://stackoverflow.com/questions/65304778
复制相似问题