【发布时间】:2019-07-18 19:57:05
【问题描述】:
我正在将 docker 应用程序部署到在 swisscom 云 (website) 上运行的云代工厂。这是我的部署脚本中的一个 sn-p。
...
export CF_DOCKER_PASSWORD=$CI_REGISTRY_PASSWORD
cf push $APP_NAME -f "$MANIFEST_FILE" --vars-file $VARS_FILE
到目前为止一切顺利,应用程序已创建并启动,没有任何问题。
Waiting for app to start...
name: app_name
requested state: started
routes: app_name.scapp.io
last uploaded: Mon 25 Feb 11:55:01 UTC 2019
stack:
docker image: registry.gitlab.com/org_name/app_name:master
type: web
instances: 1/1
memory usage: 192M
start command: npm start
state since cpu memory disk details
#0 running 2019-02-25T11:55:45Z 13.3% 95.7M of 192M 974.7M of 3G
但如果应用程序崩溃并且 CF 尝试重新启动它,我会收到以下错误。
2019-02-25 12:34:01 [CELL/0] OUT Cell 9f61c89b-5496-4f3a-a332-74084c0db365 creating container for instance 7f8762ce-d004-425e-729f-bfbd
2019-02-25 12:34:04 [CELL/0] ERR Cell 9f61c89b-5496-4f3a-a332-74084c0db365 failed to create container for instance 7f8762ce-d004-425e-729f-bfbd: running image plugin create: fetching image reference: creating image: unable to retrieve auth token: invalid username/password
2019-02-25 12:34:04 [CELL/0] ERR : exit status 1
manifest.yml
---
applications:
- name: app_name
memory: 192M
instances: 1
disk_quota: 3G
routes:
app_name.scapp.io
docker:
image: registry.gitlab.com/org_name/app_name:master
username: registry_user_here
如何让CF成功重启应用?
【问题讨论】:
标签: docker authentication cloud-foundry swisscomdev