File: remove-docker-station

package info (click to toggle)
simdutf 8.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,524 kB
  • sloc: cpp: 64,498; ansic: 15,347; python: 3,592; sh: 366; makefile: 12
file content (8 lines) | stat: -rwxr-xr-x 361 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
#!/usr/bin/env bash
tuser=$(echo $USER | tr -dc 'a-z')
container_name=${CONTAINER_NAME:-"risc-programming_station-for-$tuser"}
echo $container_name
echo " Removing the container "
docker ps -a | awk '{ print $1,$2 }' | grep $container_name| awk '{print $1 }' | xargs -I {} docker stop -t 1 {} | xargs docker rm 
# removing image
docker image rm $container_name