Skip to content

Commit 0fe4a8b

Browse files
author
Jill Grant
authored
Merge pull request #242719 from sdkadam2017/cim_release
CIM_release
2 parents 3bd1326 + f0e35eb commit 0fe4a8b

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: Azure Service Fabric container image management
3+
description: How to use container image management in a service fabric cluster.
4+
ms.topic: conceptual
5+
ms.author: shkadam
6+
author: shkadam
7+
ms.service: service-fabric
8+
services: service-fabric
9+
ms.date: 06/22/2023
10+
---
11+
12+
# Container Image Management
13+
The activation path during Service Fabric containers deployment, handles the downloading of the container images to the VM on which the containers are running. Once the containers have been removed from the cluster and their application types have been unregistered, there's a cleanup cycle that deletes the container images. This container image cleanup works only if the container image has been hard coded in the service manifest. For existing Service Fabric runtime versions, the configurations supporting the cleanup of the container images are as follows -
14+
15+
## Settings
16+
17+
```json
18+
"fabricSettings": [
19+
{
20+
"name": "Hosting",
21+
"parameters": [
22+
{
23+
"name": "PruneContainerImages",
24+
"value": "true"
25+
},
26+
{
27+
"name": "CacheCleanupScanInterval",
28+
"value": "3600"
29+
}
30+
]
31+
}
32+
]
33+
```
34+
35+
|Setting |Description |
36+
| --- | --- |
37+
|PruneContainerImage |Setting to enable or disable pruning of container images when application type is unregistered. |
38+
|CacheCleanupScanInterval |Setting in seconds determining how often the cleanup cycle runs. |
39+
40+
## Container Image Management v2
41+
Starting Service Fabric version 10.0 there's a newer version of the container image deletion flow. This flow cleans up container images irrespective of how the container images may have been defined - either hard coded or parameterized during application deployment. PruneContainerImages and ContainerImageDeletionEnabled configuration are mutually exclusive and cluster upgrade validation exists to ensure one or the other is switched on but not both. The configuration supporting this feature are as follows -
42+
43+
### Settings
44+
45+
```json
46+
"fabricSettings": [
47+
{
48+
"name": "Hosting",
49+
"parameters": [
50+
{
51+
"name": "ContainerImageDeletionEnabled",
52+
"value": "true"
53+
},
54+
{
55+
"name": "ContainerImageCleanupInterval",
56+
"value": "3600"
57+
},
58+
{
59+
"name": "ContainerImageTTL",
60+
"value": "3600"
61+
},
62+
{
63+
"name": "ContainerImageDeletionOnAppInstanceDeletionEnabled",
64+
"value": "true"
65+
},
66+
{
67+
"name": "ContainerImagesToSkip",
68+
"value": "microsoft/windowsservercore|microsoft/nanoserver"
69+
}
70+
]
71+
}
72+
]
73+
```
74+
75+
|Setting |Description |
76+
| --- | --- |
77+
|ContainerImageDeletionEnabled |Setting to enable or disable deletion of container images. |
78+
|ContainerImageCleanupInterval |Time interval for cleaning up unused container images. |
79+
|ContainerImageTTL |Time to live for container images once they're eligible for removal (not referenced by containers on the VM and the application is deleted(if ContainerImageDeletionOnAppInstanceDeletionEnabled is enabled)). |
80+
|ContainerImageDeletionOnAppInstanceDeletionEnabled |Setting to enable or disable deletion of expired ttl container images only after application has been deleted as well. |
81+
|ContainerImagesToSkip |When set enables the container runtime to skip deleting images that match any of the set of regular expressions. The \| character separates each expression. Example: "mcr.microsoft.com/.+\|docker.io/library/alpine:latest" - this example matches everything prefixed with "mcr.microsoft.com/" and matches exactly "docker.io/library/alpine:latest". By default we don't delete the known Windows base images microsoft/windowsservercore or microsoft/nanoserver. |
82+
83+
## Next steps
84+
See the following article for related information:
85+
* [Service Fabric and containers][containers-introduction-link]

articles/service-fabric/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@
178178
href: service-fabric-docker-compose.md
179179
- name: Probes
180180
href: probes-codepackage.md
181+
- name: Container image management
182+
href: container-image-management.md
181183
- name: Reliable Services
182184
items:
183185
- name: Reliable Services overview

0 commit comments

Comments
 (0)