Package: zenv-cli
ZenvZenv is container based virtual environments.
The main goal of Zenv is to simplify access to applications inside container, making it seamless in use like native (host-machine) applicationsUsage>zenvinit
Zenvcreated!

># run `ls` command inside contaner>zelsMotivationAs a developer, when set up a project locally, I usually need to install additional applications on the system. Of course, modern package managers such as poetry, pipenv, npm, cargo, ext, perfectly solve for us most of the problems with dependencies within a single stack of technologies. But they do not allow to solve the problem with the installation of system libraries. If you have a lot of projects that require different versions of system libraries, then you have problemsIn production, this problem has long been solved by container insulation, and as a rule, it is aDocker. Therefore, many of my colleagues use docker-images and docker-compose, not only to run  services in a production environment but also to develop and debug programs on a local machineUnfortunately, there are several problems along the way:Some of your familiar utilities  may not be preinstalled in the containerIf you try to install packages in the process, you will encounter the lack of necessary rightsForget about debugging withprintThe main thing is lost the usual experience, you can not use your favorite customized shellOf course, the problems described above are solved by creating a docker image specifically for developing a specific project,zenvjust helps to create such containers very simplyFeaturesSimplify: all interaction with the container occurs with one short command:zeZenv automatically forwarded current directory to the container with the same PWDZenv automatically forwarded current UserID, GroupID to containerTherefore, files created in the container have the same rights as those created in the native console and you can also usesudoto get privileges>sudoze<command>or>sudo!!Zenv can forwarded environment vars as is native>MYVAR=LIVE!!!!zeenvAnd of course your could combinate native and containerized commands in Unix pipes>zels|head-7|zetail-5Minimal performance impactCustomization: you can additionally control container parameters using ZenvfileInstallMake sure you have the latest version ofDockerinstalledFor linux, make sure you have your user’srights are allowedto interact with dokerMake sure that you have python version 3.6 or higherExecute:>sudopipinstallzenv-cli# or>sudopip3installzenv-cliHow It worksBy nature, zenv is a small automated layer over the official docker CLIinitCommandzenv initcreateZenvfilein current directory. This file describes the relationship with the docker image and container that will be created to execute isolated commands.By default, used image isubuntu: latest.
But you can change it by setting-iflag. For example:>zenvinit-ipython:latestOr editZenvfilemanuallyExecuteCommandzenv exec <COMMAND>or it shot aliasze <COMMAND>run<COMMAND>in a container environment. When running the command:Zenv checks current container status (running, stopped, removed), and up container if need.The container run with the commandsleep infinity. Therefore it will be easily accessibleUID and GID that ran the command are pushed into the container. Therefor your could usesudo ze <COMMAND>When executing the command, the directory from the path where Zenvfile is located is forwarded to the container as is a current PWD. Therefor your could runzefrom deep into directories relative to ZenvfileEnvironment variables are also thrown into the container as a native.> MYVAR=SUPER ze envTo avoid conflicts between host and container variables, all installed system variables are placed    in the blacklist when Zenvfile is created, from which editing can be removedOther commands>zenv--help
Usage:zenv[OPTIONS]COMMAND[ARGS]...ZENV(Zen-env):ContainersmanagerfordeveloperenvironmentUsage:>zenvinit-icentos:latest&zecat/etc/redhat-release

Options:--helpShowthismessageandexit.

Commands:execCallsomecommandinsidethecontainerinfoShowcurrentcontainerinfoinitInitializeEnvironment:createZenvfilermRemovecontainer(willstopthecontainer,ifneed)stopStopcontainerstop-allStopallzenvcontainersExample install jupyter notebook>mkgirnotebooks
>cdnotebooks
>zenvinit-ipython:3.7.3After edit Zenvfile to explode notebook ports. Updateports = []toports = ["8888:8888"]> sudo ze pip install jupyter numpy scipy matplotlibRun notebook> ze jupyter notebook --ip 0.0.0.0launch your browser with url:http://localhost:8888Also you could add this commands to Zenvfile:[run]init_commands=[["__create_user__"],["pip", "install", "jupyter", "numpy", "scipy", "matplotlib"]][commands]notebook=["jupyter","notebook","--ip","0.0.0.0"]And launch notebook with command> ze notebookZenvfile[main]image="ubuntu:latest"name="zenv-project"# container namedebug=false# for show docker commands[run]command=["__sleep__",]init_commands=[["__create_user__",],][exec]env_file=""env_excludes=["TMPDIR",][run.options]volume=["{zenvfilepath}:{zenvfilepath}:rw",]detach="true"publish=[][commands]__sleep__=["sleep","365d",]__create_user__=["useradd","-m","-r","-u","{uid}","-g","{gid}","zenv",]