Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ WIP / DO NOT MERGE ] Dry plugin #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clips/dry/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.gif
15 changes: 15 additions & 0 deletions clips/dry/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
PLUGIN_COMMAND ?= dry
PLUGIN_IMAGE ?= lukaszlach/clips:${PLUGIN_COMMAND}

build:
docker clip build -c ${PLUGIN_COMMAND} -t ${PLUGIN_IMAGE} .

install:
docker clip add ${PLUGIN_IMAGE}

rm:
docker clip rm ${PLUGIN_COMMAND}

reinstall: rm install

full-reinstall: build reinstall
21 changes: 21 additions & 0 deletions clips/dry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Rachid Zarouali / clips / dry

Run [dry](https://github.com/moncho/dry) and explore contents of the image layers.

![](https://raw.githubusercontent.com/lukaszlach/clip/master/clips/dive/record.gif)

```
docker dry -e DOCKER_HOST=$DOCKER_HOST
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the -e as plugin passes no parameters to the dry tool, so accepts none itself

```

## Install

```bash
$ docker clip add rachidzarouali/clips:dry
```

## Usage

```bash
$ docker dry
```
31 changes: 31 additions & 0 deletions clips/dry/docker-dry
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
# Docker Client Plugin Manager (CLIP)
# Explore contents of the image layers with the Dive tool
#
# (c) 2019 Łukasz Lach
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didn't know if i should changed that or not :)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, this one is yours

# llach@llach.pl
# https://lach.dev
usage() {
cat <<EOF

Usage: docker dry

Dry is a CLI tool to manage your docker host

EOF
}
shift
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
usage
exit 0
fi
IMAGE="$1"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This plugin accepts no parameters so 22-26 are not needed

if [ -z "$IMAGE" ]; then
echo "Error: Image was not specified"
exit 1
fi
set -e
docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
moncho/dry:latest
exit 0
6 changes: 6 additions & 0 deletions clips/dry/docker-dry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"SchemaVersion": "0.1.0",
"Vendor": "Rachid Zarouali",
"Version": "v0.9",
"ShortDescription": "a CLI tool to manage your docker host"
}