File: remove-docker-station

package info (click to toggle)
simdutf 7.7.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,244 kB
  • sloc: cpp: 60,074; ansic: 14,226; python: 3,364; sh: 321; makefile: 12
file content (8 lines) | stat: -rwxr-xr-x 361 bytes parent folder | download
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