Saravanan666/pypi-org huggingface dataset:
Package: docker-patch
Patch docker images to fit your purposes and organization requirementsInstallationpipinstalldocker-patchUsageAdd your own patch function like this:importdocker_patch@docker_patch.register_patcherdefpatcher_func(container):print(f'patch container "{container}"')container.exec_run('/bin/sh -c\'echo "hi from module 1" >> patched.txt\'')You can register multiple patchers, and then use it in one of these options:clidocker-patch<IMAGE_NAME>-m<module_name>You can add additional-m<module>as you like and make a patchers chain that work on your image (in order of appearance).
If you would like to import a module that not in your current path or installed in the interpreter libraries, you can add--add-pathlike this:# assume my_patcher is in /path/to/my_patcher.pydocker-patch<IMAGE_NAME>-mmy_patcher--add-path/path/toThis will add/path/totosys.pathso the patcher can import themy_moduleIn codeUse it directly from codeimportdockerimportdocker_patch# assume you registered patchers as shown aboveclient=docker.DockerClient()image=client.images.get('some-image')result_image=docker_patch.patch_image(image)
Package: docker-plugin-api
Docker Plugin API in PythonThis module contains some abstractions to simplify creation
of own plugins for Docker Engine.It currently contains entities for:Plugin,IpamDriver,NetworkDriver.ExamplesCheck out following real-life plugins that utilize this package:PluginTypeURLjacekkow/pyipamIpamDriverhttps://github.com/jacekkow/docker-plugin-pyipamjacekkow/pyvethNetworkDriverhttps://github.com/jacekkow/docker-plugin-pyveth
Package: docker-prepare
Docker-prepare is a tool for generating Dockerfile from a combinaisons of templatesNoteThis project is currently in development.A better documentation and testing scripts will be added in the next release.Quick start# Installationpipinstall-Udocker-prepare# Usagedocker-prepare--inputDockertemplate--outputDockerfiledocker-prepare--inputDockertemplate--outputDockerfile--env_file.env--env_file.env.local# Dockertemplate
{% include "Dockertemplate.base" %}
{% include "Dockertemplate.core" %}ContributorsJavid Mougamadou
Package: docker-printer
Docker-Printerdocker-printeris a CLI for easily managing multistep and branching dockerfiles.Regular multi-stage dockerfiles anddocker buildcommands are incredibly powerful and useful; however, they are designed for building a single image. Multistage builds can be used to define multiple related images, but this quickly results in complicated dockerfiles, possibly duplicated instructions, and complicated collections of build commands.docker-printeraddresses this in two main ways:By allowing dockerfiles to be composed from re-usable modules.By building bake files for use bydocker buildx bakethat consolidate the build processes of multiple images in multiple environments into a single configuration file.Getting Started and Documentationpip install docker-printer
docker-printer initSee thedocumentationfor how to get started.There are also example docker constructs provided in the/examplesfolder.
Package: docker-ps
$docker-psCONTAINERIMAGEPORTSSTATUS---------------------------------------------------------------redisgenee/redis:alpine172.17.0.1:6379UpAboutanhourmariadbgenee/mariadb:alpine172.17.0.1:3306UpAboutanhourginigenee/gini-dev:alpine172.17.0.1:9000UpAboutanhournginxgenee/nginx0.0.0.0:80UpAboutanhour
Package: docker_ps_traefik
docker-ps-traefikdocker-ps-traefikis a standalone script with no Python dependencies
besides what is found in the standard distribution.It works likedocker ps, except there is an additional column to
indicate container health (from Traefik's point of view).Træfikversion 2.0 or higher is required.
Træfik must be configured fordocker
integration, and it must
have the API endpoint (--api) turned on.Uses of this script:as a systems administration toolas a helper to facilitate zero-downtime rollover
Package: docker-push-ssh
docker-push-sshPush docker images from your local machine to remote servers without the hassle.Overviewdocker-push-sshis a command line utility to push docker images from your local machine to your remote machine via ssh.It creates a private docker registry on your server, establishes a ssh tunnel (so the registry is never exposed to the public),
and uploads your docker image over this ssh tunnel.Tested on OS X with "Docker for Mac".InstallInstall via pip:pip install docker-push-sshAddlocalhost:5000to your docker client's insecure registries (requires restart of docker):[OS X] How to Add Insecure Registry[Linux] How to Add Insecure RegistryAddinglocalhost:5000to your client's insecure registries is inconvenient but a side-effect of docker's design.
It only needs to be done once from each machine usingdocker-push-ssh. This allows the tool to push through the ssh
tunnel atlocalhost:5000to the temporary registry on your remote host, without needing ssl certificates for your server.Usage:$docker-push-ssh--help
usage:docker-push-ssh[-h][-iSSH_IDENTITY_FILE][-pSSH_PORT]ssh_hostdocker_image[docker_image...]Autilitytosecurelypushadockerimagefromyourlocalhosttoaremote
hostoversshwithoutusingdockersave/loadorneedingtosetupaprivate
registry.

positionalarguments:ssh_hostHosttopushdockerimageto.(ex.username@myhost.com)docker_imageDockerimagetag(s)topush.Specifyoneormoreseparatedbyspaces.

optionalarguments:-h,--helpshowthishelpmessageandexit-iSSH_IDENTITY_FILE,--ssh-identity-fileSSH_IDENTITY_FILE[required]Pathtothesshidentityfileonyourlocalhost.Required,passwordauthnotsupported.-pSSH_PORT,--ssh-portSSH_PORT[optional]Portonsshhosttoconnectto.(Defaultis22)ExamplesFirst create a test image we can use:$mkdir/tmp/testimage&&cd/tmp/testimage
$echo"FROM alpine">>./Dockerfile
$echo"RUN touch /etc/testimage">>./Dockerfile
$dockerbuild-ttestimage.Now push that test image to our remote server:$docker-push-ssh-i~/my_identity_fileroot@myserver.comtestimage
...Now thetestimagewill be present on your server.CaveatsSSH password authentication is not supported. Only key files.
Package: docker-py
A Python library for the Docker Remote API. It does everything thedockercommand does, but from within Python – run containers, manage
them, pull/push images, etc.InstallationThe latest stable version is always available on PyPi.pip install docker-pyDocumentationRead the full documentation
here. The source is
available in thedocs/directory.LicenseDocker is licensed under the Apache License, Version 2.0. See LICENSE
for full license text
Package: docker-pycreds
# docker-pycreds[![CircleCI](https://circleci.com/gh/shin-/dockerpy-creds/tree/master.svg?style=svg)](https://circleci.com/gh/shin-/dockerpy-creds/tree/master)Python bindings for the docker credentials store API## Credentials store info[Docker documentation page](https://docs.docker.com/engine/reference/commandline/login/#/credentials-store)## RequirementsOn top of the dependencies in `requirements.txt`, the `docker-credential`executable for the platform must be installed on the user's system.## API usage```pythonimport dockerpycredsstore = dockerpycreds.Store('secretservice')store.store(server='https://index.docker.io/v1/', username='johndoe',secret='hunter2')print(store.list())print(store.get('https://index.docker.io/v1/'))store.erase('https://index.docker.io/v1/')```
Package: docker-pyo3
docker-pyo3Python bindings the the rustdocker_apicrate.Basic Usagepip install docker_pyo3fromdocker_pyo3importDocker# Connecto the daemondocker=Docker()# pull an imagedocker.images().pull(image='busybox')# build an imagedocker.images().build(path="path/to/dockerfile",dockerfile='Dockerfile',tag='test-image')# run a containerc=docker.containers().create(image='busybox',name='weee')Full api examples can be seen in thepy_testfolder.Python hasdockeralready, why does this exist ?Good question. In short, because this is meant to be built into rust projects that expose python as a plugin interface. If you just need docker in python, usepip install docker, if you just need
docker in rust use thedocker_apicrate. If you need to add a python interface to containers to a rust library/binary viapyo3- this will get you most of the way.Cool how do i do that ?See the below example. But basically just follow the instructions inpyo3to register a module and set the package state. This creates the following namespaces
and classes within themroot_module._integrations.docker,Dockerroot_module._integrations.image,ImageImagesroot_module._integrations.container,ContainerContainersroot_module._integrations.network,NetworkNetworksroot_module._integrations.volume,VolumeVolumes#[pymodule]fnroot_module(_py:Python,m:&PyModule)->PyResult<()>{py_logger::register();m.add_function(wrap_pyfunction!(main,m)?)?;task::register(_py,m)?;utils::register(_py,m)?;m.add_wrapped(wrap_pymodule!(_integrations))?;letsys=PyModule::import(_py,"sys")?;letsys_modules:&PyDict=sys.getattr("modules")?.downcast()?;sys_modules.set_item("root_module._integrations",m.getattr("_integrations")?)?;sys_modules.set_item("root_module._integrations.docker",m.getattr("_integrations")?.getattr("docker")?)?;sys_modules.set_item("root_module._integrations.docker.image",m.getattr("_integrations")?.getattr("docker")?.getattr("image")?)?;sys_modules.set_item("root_module._integrations.docker.container",m.getattr("_integrations")?.getattr("docker")?.getattr("container")?)?;sys_modules.set_item("root_module._integrations.docker.network",m.getattr("_integrations")?.getattr("docker")?.getattr("network")?)?;sys_modules.set_item("root_module._integrations.docker.volume",m.getattr("_integrations")?.getattr("docker")?.getattr("volume")?)?;Ok(())}#[pymodule]fn_integrations(_py:Python,m:&PyModule)->PyResult<()>{m.add_wrapped(wrap_pymodule!(docker))?;Ok(())}#[pymodule]fndocker(_py:Python,m:&PyModule)->PyResult<()>{m.add_class::<docker_pyo3::Pyo3Docker>()?;m.add_wrapped(wrap_pymodule!(docker_pyo3::image::image))?;m.add_wrapped(wrap_pymodule!(docker_pyo3::container::container))?;m.add_wrapped(wrap_pymodule!(docker_pyo3::network::network))?;m.add_wrapped(wrap_pymodule!(docker_pyo3::volume::volume))?;Ok(())}
Package: docker-python-dev
# Docker python developer tools (a.k.a. “dpy”)This is a collection of tools meant to ease life of docker python workers.
Right now, this is work in progress.[![PyPI version][pypi-image]][pypi-url]
[![Build Status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]## Installationpip install docker-python-dev## Usageall commands support an additional-d PATHargumentdpy sanity: sanity check the docker python projectdpy style: style check the docker python projectdpy test: test the docker python projectdpy test-all: test all python version the docker python projectIf you want to create a new storage driver fordocker-registry:dpy-driver new## LicenseThis is licensed under the Apache license.[pypi-url]:https://pypi.python.org/pypi/docker-python-dev[pypi-image]:https://badge.fury.io/py/docker-python-dev.svg[travis-url]:http://travis-ci.org/dmp42/docker-python-dev[travis-image]:https://secure.travis-ci.org/dmp42/docker-python-dev.png?branch=master[coveralls-url]:https://coveralls.io/r/dmp42/docker-python-dev[coveralls-image]:https://coveralls.io/repos/dmp42/docker-python-dev/badge.png?branch=master
Package: docker-recipe
Docker RecipeUsageThrow in a filedocker-recipe.ymlin your project.Define a file.gitlab-ci.recipe.yml. This is the Jinja2 template being renderedExecute usingdocker-recipe.Installation$ pip install docker-recipeDevelopmentThis project usespre-commit.LicenseLicensed underGNU General Public License(Version 3, 29 June 2007).SeeLICENSE.md.
Package: docker-recreate
docker recreate toolsThis is a small tool to print re-create existance docker container run commands.Install# through pippipinstalldocker-recreate# using curlcurlhttps://raw.githubusercontent.com/jeffrey4l/docker-recreate/master/main.py\-o/usr/local/bin/docker-recreate
chmod+x/usr/local/bin/docker-recreate# for Chinacurlhttps://raw.fastgit.org/jeffrey4l/docker-recreate/master/main.py\-o/usr/local/bin/docker-recreate
chmod+x/usr/local/bin/docker-recreateUsage$docker-recreate-husage: docker-recreate [-h] [--format {csv,json,oneline,string,yaml}] container [container ...]positional arguments:containeroptional arguments:-h, --help            show this help message and exit--format {csv,json,oneline,string,yaml}, -f {csv,json,oneline,string,yaml}$docker-creategrafanadocker \run \-d \--name grafana \--network host \--restart always \-v grafana:/var/lib/grafana:rw \grafana/grafana:8.0.3$docker-recreateceph_osd_2docker \run \-d \--name ceph_osd_2 \--network host \--restart unless-stopped \--pid host \--privileged \-e OSD_STORETYPE=filestore \-e OSD_BS_FSUUID=e76f38d0-3f34-4771-b099-d26ee063ae01 \-e OSD_ID=2 \-e KOLLA_CONFIG_STRATEGY=COPY_ALWAYS \-e JOURNAL_PARTITION=/dev/disk/by-partuuid/9967b401-ff2b-4ed4-ac15-028e89238bdf \-e TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES=134217728 \-e KOLLA_SERVICE_NAME=ceph-osd-2 \-v kolla_logs:/var/log/kolla/:rw \-v /etc/localtime:/etc/localtime:ro \-v /etc/kolla/ceph-osd/:/var/lib/kolla/config_files/:ro \-v /dev/:/dev/:rw \-v /var/lib/ceph/osd/e76f38d0-3f34-4771-b099-d26ee063ae01:/var/lib/ceph/osd/ceph-2:rw \172.20.140.229:4000/kolla/centos-source-ceph-osd:train
Package: docker-register
Summary=======This provides a in-memory register of docker services.Author: Steven hk WongDate:   Oct 2018Credits:monitor.py is based on the work of Miki Tebeka from http://pythonwise.blogspot.com/2015/07/dockermon-docker-process-monitor.htmlDescription===========The life cycle events of create,delete and update of docker services are captured to maintain a in-memory register.At startup all active services are loaded from docker.A web UI is provided to see the jason representation of the objects. (see --help)Callbacks can be registered at startup. A callback json object is passed via stdin.Callbacks are called with "-c script|program .e.g "python -m docker-register -c jq"run eg: docker-register -c cb1.sh - cb1.sh is a simple democall back that logs callbacks input into /tmp/cb.logdocker-register -c consul_cb.sh - simple callback that register services to consul on localhost:8500The callback json object:{ "type": "service" | "container" , "operation":  "register|unregister|update" , "data": { "ports":[ { "PublishedPort": [PORT], "TargetPort":[PORT] .. ], "labels": {}, "id": "THE ID" , "name": "THE NAME]" }E.g.:{"type": "service","operation": "register","labels": {"name": "cfssl","env": "prod"},"ports": [{"PublishedPort": 8888,"TargetPort": 8888}],"name": "cfssl","id": "mq6cluihpbe89in6743r3cn1b"}Install=======To install the python module run: python setup.py installWIP===Adding containers into register.
Package: docker-registry-admin
docker-registry-functionsis a Python script that implements Docker Registry functions such as: listing repositories, listing tags from a repository, delete tags and delete a repository.GITHUBCopyright (c) 2019 Frederico Apolóniafredericojcapolo@gmail.comUsagedocker-registry list [-s|–size]docker-registry list [-s|–size] <repository>docker-registry delete <repository> <tag1> <tag2> …docker-registry delete-range <repository> <from-tag> <to-tag>docker-registry delete-repository <repository>Note: environment variableDOCKER_REGISTRY_URLmust be set for all functions to workNote: environment variableDOCKER_REGISTRY_DATA_PATHmust be set for delete-repository to workNote: environment variableDOCKER_REGISTRY_DATA_PATHis expected to specify the path tovar/lib/registry/docker/registry/v2Where list will either:List all repositories present on a specified docker registryList all tags from a<repository>
Package: docker-registry-cleaner
**Docker Registry Cleaner Tools**At [Yodle](http://www.yodle.com/), we started using Docker with a privately hosted [Docker Registry](https://github.com/docker/docker-registry). This was great until we discovered that the registry had no tools to cleanup old, unused images! Our disks began to fill up, so this was created to fill the gap.This cleaner is designed to work with the v1 Registry provided by Docker. It has not been tested against the [Registry v2](https://github.com/docker/distribution), which may have different assumptions. We will gladly accept pull requests to add support for this (see Contributing below).This tool is best used as a scheduled task, to periodicly remove cruft from your registry on disk. It is also advisible to untag old images as well. Tagged images are always referenced, so there may be cruft that this cleaner will not notice. Untagging as a feature will be included in this project as a plugin.# InstallingTo use this cleaner, clone the repository and run `python cleaner` from the project rootComing soon: `pip install docker-registry-cleaner`# WarningThis was developed against our docker repository. If your registry is different, it may cause problems. Please back up your registry and use scrub rather than purge until you are confident it works for your setup. In particular, this tool assumes you are storing your images directly on disk. It has not been designed to work with other storage drivers yet.# UsageIn order to authenticate against your registry, you need to set the following environment variables:`registry_username` and `registry_password`usage: cleaner [-h] [--hostname [HOSTNAME [HOSTNAME ...]]] [--path PATH]repository commandpositional arguments:repository            the repository pathcommand               untag, validate, report, scrub, revertoptional arguments:-h, --help            show this help message and exit--hostname [HOSTNAME [HOSTNAME ...]]the registry hostname. Required for untag--path PATH           path to tmp directory to restoreYou may want to untag old images before purging./dr_clean untag $REPOSITORY_HOME./dr_clean purge $REPOSITORY_HOMEIf you are using safe deletes, then you can also restore with./dr_clean restore $REPOSITORY_HOMEThis might be wise if you have frequent enough pushes. There is a race condition where an image may be pushed, but the reference is not written to disk yet, and it will be picked up for deletion. This won't happen if your $KEEP window is long enough though.# ContributingPull requests are welcome! All tests must pass and be pep8 compliant.Tests are run by executing ```nosetests``` in the root of the project.Style is checked by running ```pylint``` in the root of the project.# LicenseApache 2 Licensed.
Package: docker-registry-cleanup
Docker Registry CleanupCleanup images in a docker registryFree software: BSD licenseDocumentation:https://docker-registry-cleanup.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2020-09-03)First release on PyPI.
Package: docker-registry-client
A Python REST client for the Docker RegistryIt’s useful for automating image tagging and untaggingUsageThe API provides several classes:DockerRegistryClient,Repository, andImage.DockerRegistryClienthas the following methods:namespaces()-> a list of all namespaces in the registryrepository(repository_name, namespace)-> the corresponding repository objectrepositories()-> all repositories in the registryRepositoryhas the following methods:tags()-> a list of all tags in the repositorydata(tag)-> json data associated withtagimage(tag)-> the image associated withtaguntag(tag)-> removetagfrom the repositorytag(tag, image_id)-> applytagtoimage_idImagehas the following methods:get_layer()-> binary layer data for imageget_json()-> json metadata for imageget_data(field)-> single field from json dataancestry()-> ids for image ancestorsAlternativespython-dxf(only supports V2)0.5.2 (2017-06-16)Fix for “AttributeError: ‘list’ object has no attribute ‘keys’”
(Issue #41)Added usage docs inside README.rst
(Issue #39)
(Issue #45)Remove error logging when exception raised.
(Issue #37)0.5.1 (2017-01-12)Fixes to release process with zest0.5.0 (2017-01-12)First version of docker-registry-client with changelogSupport get and push manifest on protocol v2, schema v1.
(Issue #33)
Package: docker-registry-client-async
docker-registry-client-asyncOverviewAn AIOHTTP based Python REST client for the Docker Registry.Getting Startedimportasyncioimportjsonfromdocker_registry_client_asyncimportDockerRegistryClientAsync,FormattedSHA256,ImageName,Manifestasyncdefget_config(drca:DockerRegistryClientAsync,image_name:ImageName,manifest:Manifest)->bytes:config_digest=FormattedSHA256.parse(manifest.get_json()["config"]["digest"])result=awaitdrca.get_blob(image_name,config_digest)returnjson.loads(result["blob"].decode("utf-8"))asyncdefget_manifest(drca:DockerRegistryClientAsync,image_name:ImageName)->Manifest:result=awaitdrca.get_manifest(image_name)returnresult["manifest"]asyncdefmain():image_name=ImageName.parse("busybox:1.30.1")asyncwithDockerRegistryClientAsync()asdrca:manifest=awaitget_manifest(drca,image_name)config=awaitget_config(drca,image_name,manifest)print(config)if__name__=="__main__":loop=asyncio.get_event_loop()loop.run_until_complete(main())InstallationFrompypi.org$ pip install docker_registry_client_asyncFrom source code$gitclonehttps://github.com/crashvb/docker-registry-client-async
$cddocker-registry-client-async
$virtualenvenv
$sourceenv/bin/activate
$python-mpipinstall--editable.[dev]Environment VariablesVariableDefault ValueDescriptionDRCA_CACERTSThe path to the certificate trust store.DRCA_CHUNK_SIZE2097152The chunk size to use then replicating content.DRCA_CREDENTIALS_STORE~/.docker/config.jsonThe credentials store from which to retrieve registry credentials.DRCA_DEBUGAdds additional debug logging, mainly for troubleshooting and development.DRCA_DEFAULT_REGISTRYindex.docker.ioThe default registry index to use when resolving image names.DRCA_DEFAULT_NAMESPACElibraryThe default registry namespace to use when resolving image names.DRCA_DEFAULT_TAGlatestThe default image tag to use when resolving image names.DRCA_PROTOCOLhttpsThe default transport protocol to when communicating with a registry.DevelopmentSource Control
Package: docker-registry-driver-alioss
docker-registry-driver-alioss=============================This is a docker-registry backend driver based on the Open Storage Service from aliyun.com.Usage=========Assuming you have a working docker-registry and oss api setup(you can get it here： http://aliyunecs.oss-cn-hangzhou.aliyuncs.com/OSS_Python_API_20140509.zip).get source code and run:python setup.py installEdit your configuration so that storage reads ali oss.Config=========You should add all the following configurations to your main docker-registry configuration to further configure it, which by default is  config/config.yml.alioss configrations:* storage: specify the storage to use, should be alwasy alioss* storage_path: specify the path prefix in the oss bucket* oss_bucket: specify the bucket where you want to store these images for your registry* oss_accessid: the access id for the oss bucket, which you get from aliyun.com* oss_accesskey: the access key for the oss bucket, which you get from aliyun.comexample <you can copy this example into your config.yml, and modify it accordingly>:oss: &oss<<: *commonstorage: aliossstorage_path: _env:STORAGE_PATH:/devregistry/oss_bucket: _env:OSS_BUCKET[:default_value]oss_accessid: _env:OSS_KEY[:your_access_id]oss_accesskey: _env:OSS_SECRET[:your_access_key]Options=========When you run docker-registry, you can use the following two methods to configure the storage:* if you run docker-registry on your local host, export these configurations if you want to modify the default value in the configured in the config.yml:export SETTINGS_FLAVOR=ossexport STORAGE_PATH=<the prefix of the storage path>export OSS_BUCKET=<your oss bucket>export OSS_KEY=<your access id>export OSS_SECRET=<your access key>* if you run docker-registry on your docker container, remmeber to specify these settings as cmd args:docker run \-e SETTINGS_FLAVOR=oss \-e STORAGE_PATH=/dockerregistry/ \-e OSS_BUCKET=docker-registry \-e OSS_KEY=<your access id> \-e OSS_SECRET=<your access key> \-e SEARCH_BACKEND=sqlalchemy \-p 5000:5000 \registryLicense=========This is licensed under the Apache license. Most of the code here comes from docker-registry, under an Apache license as well.