Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Collect Only PR check] Force remove "sonic-mgmt-collect" container b…
…efore "docker run" (#16509) The "Collect Only" PR check needs to spawn a new "sonic-mgmt-collect" container to run the check. If the agent instance is not brand new, it could already has a "sonic-mgmt-collect" container running. Then creating another "sonic-mgmt-collect" container would run int conflicts. The error log is like below: + sudo docker run --rm -dt --name sonic-mgmt-collect -v /agent/_work/1/s:/var/src/sonic-mgmt sonicdev-microsoft.azurecr.io:443/docker-sonic-mgmt:latest /bin/bash docker: Error response from daemon: Conflict. The container name "/sonic-mgmt-collect" is already in use by container "767ed83745baf81fa476bacc22302bce5c111c9afc1f7a5d8e763a996fb776e1". You have to remove (or rename) that container to be able to reuse that name. This change added a step to always force remove "sonic-mgmt-collect" container. Then the subsequent step of creating such container will not run into name conflicting issue. Signed-off-by: Xin Wang <xiwang5@microsoft.com>
- Loading branch information