feat: retire intermediate containers after use
Rather than waiting for the next deploy, take advantage of the retire system to retire these containers immediately. Note that since the retire process happens out of band, the containers may stick around for up to 5 minutes, after which point they will be removed. Customization of the wait time to retire - currently 60 seconds - is up for future debate. The containers ultimately haven't been useful for debugging, so keeping them around for longer won't help in most cases, and folks can disable the dokku-retire service (or cron) if that is desired.
This commit is contained in:
@@ -420,6 +420,7 @@ copy_from_image() {
|
||||
local CID=$("$DOCKER_BIN" container create "${DOCKER_CREATE_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS "$IMAGE")
|
||||
"$DOCKER_BIN" container cp "$CID:$SRC_FILE" "$TMP_FILE_COMMAND_OUTPUT" 2>/dev/null || true
|
||||
"$DOCKER_BIN" container rm --force "$CID" &>/dev/null
|
||||
plugn trigger scheduler-register-retired "$APP" "$CID"
|
||||
|
||||
# docker cp exits with status 1 when run as non-root user when it tries to chown the file
|
||||
# after successfully copying the file. Thus, we suppress stderr.
|
||||
|
||||
Reference in New Issue
Block a user