Closed ebattat closed 2 months ago
@RobertKrawitz, any comments ?
@RobertKrawitz, You right, fix it with the following code:
# Check if the image exists
if [[ "$(sudo podman images -q ${QUAY_BENCHMARK_RUNNER_REPOSITORY} 2> /dev/null)" != "" ]]; then
# Get containers using the image
containers=$(sudo podman ps -a --filter ancestor=${QUAY_BENCHMARK_RUNNER_REPOSITORY} -q)
if [[ "$containers" != "" ]]; then
echo "Stopping and removing containers using the image..."
sudo podman stop $containers
sudo podman rm $containers
fi
# Now remove the image
sudo podman rmi -f $(sudo podman images -q ${QUAY_BENCHMARK_RUNNER_REPOSITORY} 2> /dev/null)
fi
@RobertKrawitz, You right, fix it with the following code:
# Check if the image exists if [[ "$(sudo podman images -q ${QUAY_BENCHMARK_RUNNER_REPOSITORY} 2> /dev/null)" != "" ]]; then # Get containers using the image containers=$(sudo podman ps -a --filter ancestor=${QUAY_BENCHMARK_RUNNER_REPOSITORY} -q) if [[ "$containers" != "" ]]; then echo "Stopping and removing containers using the image..." sudo podman stop $containers sudo podman rm $containers fi # Now remove the image sudo podman rmi -f $(sudo podman images -q ${QUAY_BENCHMARK_RUNNER_REPOSITORY} 2> /dev/null) fi
Might as well do podman rm -f
just to be certain.
I want to remove the image and not only the running container, thats the reason I must use rmi and not rm
I want to remove the image and not only the running container, thats the reason I must use rmi and not rm
Agreed, but when you do podman rm
(if there are any containers), you should use podman rm -f
to ensure that the containers are removed before you try to podman rmi
.
@RobertKrawitz, got it. fixed.
@RobertKrawitz, do you have any further comments?
Type of change
Note: Fill x in []
Description
Add PerfCI Chaos Jenkinsfile Workflows under jenkins/PerfCI-Chaos
Reformat all the folder names under jenkins/PerfCI
For security reasons, all pull requests need to be approved first before running any automated CI