by se7entyse7en · 7y ago · 0 comments
Under the hood the creation of an environment corresponds to the creation of a docker container (that's how it relates to docker). The docker container is built starting from a the official python docker images as you can see here https://github.com/se7entyse7en/pydockenv/blob/master/pydock....
The activation of the environment corresponds to the start of the container. Hence inside the container, you don't have (don't need) to have any virtual env as the isolation is already provided by the container itself.
Every time you install a dependency, this is actually installed inside the container.
Seems wild to pass around the actual container rather than an image that spawns your environment.
Under the hood, a new docker image is saved from the container corresponding to the currently active environment. A `*.tar.gz` file is created with the image the can be now loaded using `pydockenv load`.
Alternatively, you could push that image to Dockerhub for example and pull it from somewhere else. The problem is that currently there's no mechanism to make it recognize to `pydockenv`, but I'm also planning to add the possibility to create an environment from a user-defined image.
Using `pydockenv save` will ensure that the environment you'll share will be exactly the same. An alternative that I'm also planning to implement is to use a `toml` file that will simply create a new environment from it. Obviously, in your running container, there could be something not captured in the original `toml` file if you, for example, installed something manually inside the container.
But again, it's really in early stage, so all these feedbacks are really welcome!