Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/z0mbix/docker-ctl
Docker wrapper script for common tasks
https://github.com/z0mbix/docker-ctl
docker wrapper
Last synced: about 1 month ago
JSON representation
Docker wrapper script for common tasks
- Host: GitHub
- URL: https://github.com/z0mbix/docker-ctl
- Owner: z0mbix
- License: mit
- Created: 2016-01-04T12:15:59.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-23T12:42:39.000Z (almost 9 years ago)
- Last Synced: 2024-04-17T20:13:12.830Z (9 months ago)
- Topics: docker, wrapper
- Language: Shell
- Size: 3.91 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
docker-ctl
----------Like Docker, but have a terrible memory, or a little bit lazy? Then you may need **docker-ctl**
To see all commands just run docker-ctl with no arguments:
# docker-ctl
Available commands:
cleanup
help
remove-all
remove-all-images
remove-stopped
show-ports
show-running
show-stopped
stop-runningTo see more details use the help option:
# docker-ctl help
cleanup
Removes stopped containers and dangling imageshelp
Shows help information for a commandremove-all
Removes all containersremove-all-images
Removes all imagesremove-stopped
Removes all stopped containersshow-ports
Show port mappings for running containersshow-running
Shows all running containersshow-stopped
Shows all stopped containersstop-running
Stops all running containersTo see full help details for a command use **docker-ctl help [command]** e.g.:
# docker-ctl help remove-all
remove-all
Removes all containerscmd-remove-all ()
{
declare desc="Removes all containers";
local containers=$(docker ps -a -q);
for container in ${containers[@]};
do
local state=$(docker inspect --format "{{.State.Running}}" $container);
echo "Removing container: $container";
if [[ "$state" == "true" ]]; then
stop-container $container;
fi;
remove-container $container;
done
}## Install
$ sudo curl https://raw.githubusercontent.com/z0mbix/docker-ctl/master/docker-ctl -o /usr/local/bin/docker-ctl && sudo chmod 755 /usr/local/bin/docker-ctl