summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCan Güney Aksakalli <cgaksakalli@gmail.com>2020-09-28 01:59:08 +0200
committerGitHub <noreply@github.com>2020-09-28 01:59:08 +0200
commitc280f660e82869c72c6f4e2e4cd391ed0e6f67c8 (patch)
treec795a2e939e9a00226b1f6d321abbac46d7111eb
parent6e08a3fcce04565e491b3ea450c10864186354d1 (diff)
parentbe55dd94a2a299fb85bc505ea9ed7bc39788bb8e (diff)
Merge pull request #101 from snpranav/docker-exec
Executable to run gtop in docker container.
-rw-r--r--README.md9
-rwxr-xr-xgtop-docker.sh19
2 files changed, 28 insertions, 0 deletions
diff --git a/README.md b/README.md
index 54ec20e..eb0d8e8 100644
--- a/README.md
+++ b/README.md
@@ -33,6 +33,15 @@ $ docker run --rm -it \
aksakalli/gtop
```
+-OR-
+
+Run gtop in your terminal using the `gtop` command, but in a docker container by running the following lines.
+```sh
+$ sh -c "$(curl -fSsL https://raw.githubusercontent.com/aksakalli/gtop/master/gtop-docker.sh)"
+
+$ gtop # Run gtop from your terminal whenever you want to open gtop.
+```
+
### Usage
Start gtop with the `gtop` command
diff --git a/gtop-docker.sh b/gtop-docker.sh
new file mode 100755
index 0000000..a5824c4
--- /dev/null
+++ b/gtop-docker.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+#########################################
+# Run gtop in your terminal using the `gtop` command, but in a docker container by running the following lines.
+# ```sh
+# $ sh -c "$(curl -fSsL https://raw.githubusercontent.com/aksakalli/gtop/master/gtop-docker.sh)"
+
+# $ gtop # Run gtop from your terminal whenever you want to open gtop.
+#########################################
+
+sudo tee /usr/local/bin/gtop > /dev/null << EOF
+docker run --rm -it \
+ --name gtop-from-executable \
+ --net="host" \
+ --pid="host" \
+ aksakalli/gtop
+EOF
+
+sudo chmod 555 /usr/local/bin/gtop