我目前在Amazon ECS中有一个Nginx Docker映像。我需要通过certbot重新颁发SSL证书,并且需要删除旧证书。如何删除该卷?我当前将使用新卷而不是旧卷(附加“ v2”后缀)。
这是我的任务定义的一部分(如上所述,我不得不将其重命名为v2):
"mountPoints": [
{
"sourceVolume": "nginx-certbot-v2",
"containerPath": "/etc/letsencrypt",
"readOnly": false
},
{
"sourceVolume": "nginx-acme-webroot-v2",
"containerPath": "/var/acme-webroot",
"readOnly": false
},
{
"sourceVolume": "nginx-dhparam-v2",
"containerPath": "/etc/nginx/dhparam",
"readOnly": false
}
],
这是音量的定义:
"volumes": [
{
"name": "nginx-certbot-v2",
"dockerVolumeConfiguration": {
"scope": "shared",
"autoprovision": true,
"driver": "local"
}
},
{
"name": "nginx-acme-webroot-v2",
"dockerVolumeConfiguration": {
"scope": "shared",
"autoprovision": true,
"driver": "local"
}
},
{
"name": "nginx-dhparam-v2",
"dockerVolumeConfiguration": {
"scope": "shared",
"autoprovision": true,
"driver": "local"
}
}
]
我是否有可能在没有“ v2”的情况下找回卷?
答案 0 :(得分:1)
将Docker卷的范围定义为任务而不是共享,它将在任务停止后自动删除。
"volumes": [
{
"name": "scratch",
"dockerVolumeConfiguration" : {
"scope": "task",
"autoprovision": true,
"driver": "local",
"labels": {
"scratch": "space"
}
}
}
]
请参阅此链接以获取更多信息