From a391c2388c86dbe0ebfd4992de2042575cd0bd2c Mon Sep 17 00:00:00 2001 From: Atanu Roy Date: Fri, 17 Jun 2022 16:46:01 +0530 Subject: [PATCH 1/3] clean command implemented for image --- dckr/images.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dckr/images.py b/dckr/images.py index 2d511ba..e58446e 100644 --- a/dckr/images.py +++ b/dckr/images.py @@ -26,8 +26,8 @@ def HandleImage(client): if sys.argv[2].lower() == 'clean': choice = input(f'Total {colorize.colorizeNumber(len(images))} will be removed. Proceed (y/n)? ') if choice.lower() == 'y' or choice.lower() == 'yes': - # for i in images: - # client.images.remove(i.attrs['Id'][7:19]) + for i in images: + client.images.remove(i.attrs['Id'][7:19], force=True) print(f'All images removed') else: print(f'Image remove aborted') From 1d2d708d1ff782f86fc6ae91e23bab0301849b97 Mon Sep 17 00:00:00 2001 From: Atanu Roy Date: Fri, 17 Jun 2022 18:50:59 +0530 Subject: [PATCH 2/3] added script to generate docker artifacts --- test/create_objects.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 test/create_objects.sh diff --git a/test/create_objects.sh b/test/create_objects.sh new file mode 100755 index 0000000..fb5ef89 --- /dev/null +++ b/test/create_objects.sh @@ -0,0 +1,14 @@ +# pull images +docker pull busybox +docker pull hello-world +docker pull alpine + +# start containers +docker run -d busybox +docker run -d hello-world +docker run -d alpine + +# create volumes +docker volume create --driver local volume1 +docker volume create --driver local volume2 +docker volume create --driver local volume3 \ No newline at end of file From a736dfa4735b79bc2321b67a37feb1307eccd598 Mon Sep 17 00:00:00 2001 From: Atanu Roy Date: Fri, 17 Jun 2022 22:28:30 +0530 Subject: [PATCH 3/3] docu changes for release --- .github/workflows/build_executables.yml | 44 ++++++++++++------------- README.md | 9 +++++ releasenotes.md | 8 ++--- 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build_executables.yml b/.github/workflows/build_executables.yml index 9c8479e..95503e6 100644 --- a/.github/workflows/build_executables.yml +++ b/.github/workflows/build_executables.yml @@ -31,25 +31,25 @@ jobs: cd dist/ && tar -czvf ../dckr_v0.${{ github.run_number }}_linux.tar.gz . && cd .. ls -l dckr_v0.${{ github.run_number }}_linux.tar.gz - # - name: Create Release - # id: create_release - # uses: actions/create-release@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # tag_name: v0.${{ github.run_number }} - # release_name: v0.${{ github.run_number }} - # body_path: ./releasenotes.md - # draft: false - # prerelease: true - - # - name: Upload Release Asset - # id: upload-release-asset - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - # asset_path: ./dckr_v0.${{ github.run_number }}_linux.tar.gz - # asset_name: dckr_v0.${{ github.run_number }}_linux.tar.gz - # asset_content_type: application/zip + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v0.${{ github.run_number }} + release_name: v0.${{ github.run_number }} + body_path: ./releasenotes.md + draft: false + prerelease: true + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./dckr_v0.${{ github.run_number }}_linux.tar.gz + asset_name: dckr_v0.${{ github.run_number }}_linux.tar.gz + asset_content_type: application/zip diff --git a/README.md b/README.md index ff9d09c..380ef27 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,18 @@ A Docker CLI alternative with shortcuts and added functionalities ![List functionality](documentation/images/screenshot_list.png?raw=true) * ### **Cleanup** arguments *dckr* provides shortcuts to bulk cleanup of docker artifacts by running single command + + `./dckr container clean` will delete all containers at one go * ### **Colored** console output *dckr* prints colored texts in console for highlighting key information (e.g. # of items, status etc.) +**** +## How to use this utility + +Instructions to use the CLI to can be found by running `./dckr help` + +Refer `dckr/help.py` for details + **** ## How to build the executable from source ### Prerequisites diff --git a/releasenotes.md b/releasenotes.md index bd0d398..85f7ec3 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -1,7 +1,7 @@ Functions currently available with this build -- Docker artifacts -> container and image -- search and list +- Docker artifacts -> container, image, volume +- search, list, clean Changes in this Release -- Workflow updated for automatic release creation and artifact upload -- README.md updated \ No newline at end of file +- support for volume added +- CLI help added \ No newline at end of file