You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

dih

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dih

A tool to save and load the docker image tarball file

0.0.1.4
pipPyPI
Maintainers
1

cover

DIH: Docker Image Handler

A tool to save and load the docker image tarball file.

GitHub License GitHub Workflow Status (with event) GitHub tag checks state GitHub issues

Codecov PyPI - Version PyPI - Python Version PyPI - Downloads PyPI - Status

Requirements

  • python >=3.8
  • Virtualenv, VirtualenvWrapper

Install module with PyPI

mkvirtualenv dih
pip install dih

Load docker image with tarball file

  • Load docker image with specific folder or file

    dih load -f ./archives
    
  • Load docker image with manual selection

    dih load -f ./archives --select
    
    Sample


    Enter the index of the docker images...


  • Load docker image with specific folder and verify with compose file.

    dih load -f ./archives -c <path/to/compose>
    
    Sample


    Verify with compose file and only load the verified indexes...


Save docker image into tarball file

  • Save docker image into tarball file.

    dih save -f ./archives
    
  • Filter with specific rule, includes something and excludes something.

    dih save -f ./archives -inc innodisk -exc none
    
    Sample


    dih save -f ./archives -inc rtsp -exc none...


More detail

  • dih load --help
    Usage: dih load [OPTIONS]
    
    Options:
    -f, --folder PATH        Path to the folder.  [required]
    -c, --compose-file PATH  Path to compose file.
    -s, --select             Select by index.
    --debug                  Only display the information.
    --help                   Show this message and exit.
    
  • dih save --help
    Usage: dih save [OPTIONS]
    
    Options:
    -f, --folder TEXT      Path to the folder.  [required]
    -inc, --includes TEXT  Include keys.
    -exc, --excludes TEXT  Exclude keys.
    --debug                Only display the information.
    --help                 Show this message and exit.
    

For Local Developer

For Developer ( Docker )

  • Requirements
    • Docker engine
  • Usage
    • Help
      Usage: ./docker/handler.sh [mode] [ubuntu] [command]
          
      Options:
          - mode: build|run
          - ubuntu: focal|20.04|jammy|22.04
          - command: only supported when 'handler.sh run'. e.g."bash" 
      
    • For example
      # Build docker image
      ./docker/handler.sh build focal
      # Run docker container with specific version and command
      ./docker/handler.sh run focal "bash" 
      

Testing

pytest -v
pytest --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html

Distribute

python3 -m pip install --upgrade build
sudo apt install python3.10-venv
python3 -m build
twine upload dist/*

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts