Marked all our images with eshop/ and added a delete-images.ps1 for eShop images
This commit is contained in:
parent
f68fee6513
commit
aae8283798
@ -82,15 +82,14 @@ $imagesToDelete = docker images --filter=reference="eshop/*" -q
|
|||||||
If (-Not $imagesToDelete) {Write-Host "Not deleting eShop images as there are no eShop images in the current local Docker repo."}
|
If (-Not $imagesToDelete) {Write-Host "Not deleting eShop images as there are no eShop images in the current local Docker repo."}
|
||||||
Else
|
Else
|
||||||
{
|
{
|
||||||
# Delete all eshop containers
|
# Delete all containers
|
||||||
Write-Host "Deleting eShop containers in local Docker Host"
|
Write-Host "Deleting all containers in local Docker Host"
|
||||||
docker rm $($imagesToDelete) -f
|
docker rm $(docker ps -a -q) -f
|
||||||
#docker rm $(docker images --filter=reference="eshop/*" -q) -f
|
|
||||||
|
|
||||||
# Delete all eshop images
|
# Delete all eshop images
|
||||||
Write-Host "Deleting eShop images in local Docker repo"
|
Write-Host "Deleting eShop images in local Docker repo"
|
||||||
docker rm $($imagesToDelete) -f
|
Write-Host $imagesToDelete
|
||||||
#docker rmi $(docker images --filter=reference="eshop/*" -q)
|
docker rmi $(docker images --filter=reference="eshop/*" -q) -f
|
||||||
}
|
}
|
||||||
|
|
||||||
#*** build docker images ***
|
#*** build docker images ***
|
||||||
|
28
delete-images.ps1
Normal file
28
delete-images.ps1
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path
|
||||||
|
|
||||||
|
Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow
|
||||||
|
|
||||||
|
$imagesToDelete = docker images --filter=reference="eshop/*" -q
|
||||||
|
|
||||||
|
If (-Not $imagesToDelete) {Write-Host "Not deleting eShop images as there are no eShop images in the current local Docker repo."}
|
||||||
|
Else
|
||||||
|
{
|
||||||
|
# Delete all containers
|
||||||
|
Write-Host "Deleting all containers in local Docker Host"
|
||||||
|
docker rm $(docker ps -a -q) -f
|
||||||
|
|
||||||
|
# Delete all eshop images
|
||||||
|
Write-Host "Deleting eShop images in local Docker repo"
|
||||||
|
Write-Host $imagesToDelete
|
||||||
|
docker rmi $(docker images --filter=reference="eshop/*" -q) -f
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# DELETE ALL IMAGES AND CONTAINERS
|
||||||
|
|
||||||
|
# Delete all containers
|
||||||
|
# docker rm $(docker ps -a -q) -f
|
||||||
|
|
||||||
|
# Delete all images
|
||||||
|
# docker rmi $(docker images -q)
|
||||||
|
|
@ -2,7 +2,7 @@ version: '2'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
basket.api:
|
basket.api:
|
||||||
image: basket.api:dev
|
image: eshop/basket.api:dev
|
||||||
build:
|
build:
|
||||||
args:
|
args:
|
||||||
source: ${DOCKER_BUILD_SOURCE}
|
source: ${DOCKER_BUILD_SOURCE}
|
||||||
@ -17,7 +17,7 @@ services:
|
|||||||
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
|
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
|
||||||
|
|
||||||
catalog.api:
|
catalog.api:
|
||||||
image: catalog.api:dev
|
image: eshop/catalog.api:dev
|
||||||
build:
|
build:
|
||||||
args:
|
args:
|
||||||
source: ${DOCKER_BUILD_SOURCE}
|
source: ${DOCKER_BUILD_SOURCE}
|
||||||
@ -32,7 +32,7 @@ services:
|
|||||||
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
|
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
|
||||||
|
|
||||||
identity.api:
|
identity.api:
|
||||||
image: identity.api:dev
|
image: eshop/identity.api:dev
|
||||||
build:
|
build:
|
||||||
args:
|
args:
|
||||||
source: ${DOCKER_BUILD_SOURCE}
|
source: ${DOCKER_BUILD_SOURCE}
|
||||||
@ -47,7 +47,7 @@ services:
|
|||||||
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
|
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
|
||||||
|
|
||||||
ordering.api:
|
ordering.api:
|
||||||
image: ordering.api:dev
|
image: eshop/ordering.api:dev
|
||||||
build:
|
build:
|
||||||
args:
|
args:
|
||||||
source: ${DOCKER_BUILD_SOURCE}
|
source: ${DOCKER_BUILD_SOURCE}
|
||||||
@ -62,7 +62,7 @@ services:
|
|||||||
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
|
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
|
||||||
|
|
||||||
eshoponcontainers.webspa:
|
eshoponcontainers.webspa:
|
||||||
image: eshoponcontainers.webspa:dev
|
image: eshop/eshoponcontainers.webspa:dev
|
||||||
build:
|
build:
|
||||||
args:
|
args:
|
||||||
source: ${DOCKER_BUILD_SOURCE}
|
source: ${DOCKER_BUILD_SOURCE}
|
||||||
@ -77,7 +77,7 @@ services:
|
|||||||
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
|
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
|
||||||
|
|
||||||
webmvc:
|
webmvc:
|
||||||
image: webmvc:dev
|
image: eshop/webmvc:dev
|
||||||
build:
|
build:
|
||||||
args:
|
args:
|
||||||
source: ${DOCKER_BUILD_SOURCE}
|
source: ${DOCKER_BUILD_SOURCE}
|
||||||
|
@ -2,7 +2,7 @@ version: '2'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
basket.api:
|
basket.api:
|
||||||
image: basket.api
|
image: eshop/basket.api
|
||||||
build:
|
build:
|
||||||
context: ./src/Services/Basket/Basket.API
|
context: ./src/Services/Basket/Basket.API
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
@ -11,7 +11,7 @@ services:
|
|||||||
- identity.api
|
- identity.api
|
||||||
|
|
||||||
catalog.api:
|
catalog.api:
|
||||||
image: catalog.api
|
image: eshop/catalog.api
|
||||||
build:
|
build:
|
||||||
context: ./src/Services/Catalog/Catalog.API
|
context: ./src/Services/Catalog/Catalog.API
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
@ -19,7 +19,7 @@ services:
|
|||||||
- sql.data
|
- sql.data
|
||||||
|
|
||||||
identity.api:
|
identity.api:
|
||||||
image: identity.api
|
image: eshop/identity.api
|
||||||
build:
|
build:
|
||||||
context: ./src/Services/Identity/Identity.API
|
context: ./src/Services/Identity/Identity.API
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
@ -27,7 +27,7 @@ services:
|
|||||||
- sql.data
|
- sql.data
|
||||||
|
|
||||||
ordering.api:
|
ordering.api:
|
||||||
image: ordering.api
|
image: eshop/ordering.api
|
||||||
build:
|
build:
|
||||||
context: ./src/Services/Ordering/Ordering.API
|
context: ./src/Services/Ordering/Ordering.API
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
@ -35,7 +35,7 @@ services:
|
|||||||
- sql.data
|
- sql.data
|
||||||
|
|
||||||
eshoponcontainers.webspa:
|
eshoponcontainers.webspa:
|
||||||
image: eshoponcontainers.webspa
|
image: eshop/eshoponcontainers.webspa
|
||||||
build:
|
build:
|
||||||
context: ./src/Web/WebSPA/eShopOnContainers.WebSPA
|
context: ./src/Web/WebSPA/eShopOnContainers.WebSPA
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
@ -44,7 +44,7 @@ services:
|
|||||||
- basket.api
|
- basket.api
|
||||||
|
|
||||||
webmvc:
|
webmvc:
|
||||||
image: webmvc
|
image: eshop/webmvc
|
||||||
build:
|
build:
|
||||||
context: ./src/Web/WebMVC
|
context: ./src/Web/WebMVC
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user