From b66b4262f67477b9e102111fb4374a732edfab75 Mon Sep 17 00:00:00 2001 From: Dominic Kolbe Date: Thu, 8 Feb 2024 02:29:41 +0000 Subject: [PATCH] Add Docker scripts and system utilities*** This commit adds several Docker scripts for managing containers, volumes, networks, and system cleanup. It also includes scripts for displaying Docker processes and system analysis. Additionally, it includes a script to output the architecture of the machine. These scripts will help with Docker container management and system analysis tasks. --- docker/add-user-to-docker.sh | 1 + docker/docker create volume.sh | 1 + docker/docker-compose-update.sh | 1 + docker/docker-create-network.sh | 1 + docker/docker-kill-all.sh | 1 + docker/docker-prune-system.sh | 1 + docker/docker-ps.sh | 1 + system/arch.sh | 2 ++ system/systemd-analyze-blame.sh | 1 + 9 files changed, 10 insertions(+) create mode 100644 docker/add-user-to-docker.sh create mode 100644 docker/docker create volume.sh create mode 100644 docker/docker-compose-update.sh create mode 100644 docker/docker-create-network.sh create mode 100644 docker/docker-kill-all.sh create mode 100644 docker/docker-prune-system.sh create mode 100644 docker/docker-ps.sh create mode 100644 system/arch.sh create mode 100644 system/systemd-analyze-blame.sh diff --git a/docker/add-user-to-docker.sh b/docker/add-user-to-docker.sh new file mode 100644 index 0000000..cb4cb3f --- /dev/null +++ b/docker/add-user-to-docker.sh @@ -0,0 +1 @@ +sudo usermod -a -G docker $USER diff --git a/docker/docker create volume.sh b/docker/docker create volume.sh new file mode 100644 index 0000000..d65cdc6 --- /dev/null +++ b/docker/docker create volume.sh @@ -0,0 +1 @@ +docker volume create ${volume_name} diff --git a/docker/docker-compose-update.sh b/docker/docker-compose-update.sh new file mode 100644 index 0000000..93533e3 --- /dev/null +++ b/docker/docker-compose-update.sh @@ -0,0 +1 @@ +docker compose down && docker compose pull && docker compose up -d diff --git a/docker/docker-create-network.sh b/docker/docker-create-network.sh new file mode 100644 index 0000000..d9bf7b6 --- /dev/null +++ b/docker/docker-create-network.sh @@ -0,0 +1 @@ +docker network create ${network_name} diff --git a/docker/docker-kill-all.sh b/docker/docker-kill-all.sh new file mode 100644 index 0000000..b8180f8 --- /dev/null +++ b/docker/docker-kill-all.sh @@ -0,0 +1 @@ +docker kill $(docker ps -q) diff --git a/docker/docker-prune-system.sh b/docker/docker-prune-system.sh new file mode 100644 index 0000000..5946fc0 --- /dev/null +++ b/docker/docker-prune-system.sh @@ -0,0 +1 @@ +docker system prune --all --force --volumes && docker volume prune --all --force && docker network prune --force diff --git a/docker/docker-ps.sh b/docker/docker-ps.sh new file mode 100644 index 0000000..ae182de --- /dev/null +++ b/docker/docker-ps.sh @@ -0,0 +1 @@ +docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Networks}}\t{{.Status}}\t{{.Ports}}" diff --git a/system/arch.sh b/system/arch.sh new file mode 100644 index 0000000..c06ffd4 --- /dev/null +++ b/system/arch.sh @@ -0,0 +1,2 @@ +arch +# output the architecture of your machine diff --git a/system/systemd-analyze-blame.sh b/system/systemd-analyze-blame.sh new file mode 100644 index 0000000..ea53093 --- /dev/null +++ b/system/systemd-analyze-blame.sh @@ -0,0 +1 @@ +systemd-analyze blame \ No newline at end of file