Skip to content

Modern Docker Management, Designed for Everyone

fix: allow force removing of images (#2530)

Kyle Mendell2db055f953c2
diff --git a/frontend/messages/en.json b/frontend/messages/en.json
index 762892d52..c8b243243 100644
--- a/frontend/messages/en.json
+++ b/frontend/messages/en.json
@@ -698,6 +698,7 @@
"images_remove_selected_title": "Remove {count} Image(s)",
"images_remove_selected_message": "Are you sure you want to remove the selected image(s)? This action cannot be undone.",
"images_remove_message": "Are you sure you want to remove this image? This action cannot be undone.",
+ "images_remove_force_label": "Force remove",
"images_pull_no_tag": "Cannot pull image without repository tag",
"images_untagged": "Untagged",
"images_repository": "Repository",
diff --git a/frontend/src/routes/(app)/images/[imageId]/+page.svelte b/frontend/src/routes/(app)/images/[imageId]/+page.svelte
index ea42e2bd2..c4888bc75 100644
--- a/frontend/src/routes/(app)/images/[imageId]/+page.svelte
+++ b/frontend/src/routes/(app)/images/[imageId]/+page.svelte
@@ -199,12 +199,20 @@
openConfirmDialog({
title: m.common_remove_title({ resource: m.resource_image() }),
message: m.images_remove_message(),
+ checkboxes: [
+ {
+ id: 'force',
+ label: m.images_remove_force_label(),
+ initialState: false
+ }
+ ],
confirm: {
label: m.common_delete(),
destructive: true,
- action: async () => {
+ action: async (checkboxStates) => {
+ const force = !!checkboxStates.force;
await handleApiResultWithCallbacks({
- result: await tryCatch(imageService.deleteImage(id)),
+ result: await tryCatch(imageService.deleteImage(id, { force })),
message: m.images_remove_failed(),
setLoadingState: (value) => (isLoading.removing = value),
onSuccess: async () => {
diff --git a/frontend/src/routes/(app)/images/image-table.svelte b/frontend/src/routes/(app)/images/image-table.svelte
index aa24e28c1..6ac316bc9 100644
--- a/frontend/src/routes/(app)/images/image-table.svelte
+++ b/frontend/src/routes/(app)/images/image-table.svelte
@@ -79,16 +79,24 @@
openConfirmDialog({
title: m.images_remove_selected_title({ count: ids.length }),
message: m.images_remove_selected_message({ count: ids.length }),
+ checkboxes: [
+ {
+ id: 'force',
+ label: m.images_remove_force_label(),
+ initialState: false
+ }
+ ],
confirm: {
label: m.common_remove(),
destructive: true,
- action: async () => {
+ action: async (checkboxStates) => {
+ const force = !!checkboxStates.force;
isLoading.removing = true;
let successCount = 0;
let failureCount = 0;
for (const id of ids) {
- const result = await tryCatch(imageService.deleteImage(id));
+ const result = await tryCatch(imageService.deleteImage(id, { force }));
handleApiResultWithCallbacks({
result,
message: m.images_remove_failed(),
@@ -123,13 +131,21 @@
openConfirmDialog({
title: m.common_remove_title({ resource: m.resource_image() }),
message: m.images_remove_message(),
+ checkboxes: [
+ {
+ id: 'force',
+ label: m.images_remove_force_label(),
+ initialState: false
+ }
+ ],
confirm: {
label: m.common_remove(),
destructive: true,
- action: async () => {
+ action: async (checkboxStates) => {
+ const force = !!checkboxStates.force;
isLoading.removing = true;
- const result = await tryCatch(imageService.deleteImage(id));
+ const result = await tryCatch(imageService.deleteImage(id, { force }));
handleApiResultWithCallbacks({
result,
message: m.images_remove_failed(),