Skip to content

Instantly share code, notes, and snippets.

View christosavg's full-sized avatar

Christos Avgerinos christosavg

View GitHub Profile
@christosavg
christosavg / container_reset.sh
Last active January 31, 2020 09:14
Fast and easy way to stop and remove a Docker container as well as its leftovers using BASH
#!/bin/bash
container_name=YOUR_CONTAINER_NAME
if [[ ! -z $(docker ps | grep $container_name) ]]
then
echo found $container_name container
sudo docker kill $(docker ps | grep $container_name| cut -f 1 -d " ");
echo killed $container_name container
else