Attempting to prune containers on startup always.

This commit is contained in:
mike12345567 2024-12-16 21:21:30 +00:00
parent 618d8a5723
commit 21aba2fc71
2 changed files with 4 additions and 2 deletions

View File

@ -178,6 +178,7 @@ jobs:
- name: Pull testcontainers images
run: |
docker system prune -f
if [ "${{ matrix.datasource }}" == "mssql" ]; then
docker pull mcr.microsoft.com/mssql/server@${{ steps.dotenv.outputs.MSSQL_SHA }}
elif [ "${{ matrix.datasource }}" == "mysql" ]; then

View File

@ -39,7 +39,6 @@ function getTestcontainers(): ContainerInfo[] {
function removeContainer(container: ContainerInfo) {
execSync(`docker rm -f ${container.ID}`)
execSync(`docker system prune -f`)
}
export function getContainerByImage(image: string) {
@ -55,7 +54,9 @@ export function getContainerByImage(image: string) {
}
function getContainerByName(name: string) {
return getTestcontainers().find(x => x.Names.includes(name))
return getTestcontainers().find(x =>
x.Names.toLowerCase().includes(name.toLowerCase())
)
}
export function getContainerById(id: string) {