4 ms·
When I have some time I could try adding a `How does it work` section. Under the hood the creation of an environment corresponds to the creation of a docker co
by se7entyse7en 7y ago
When I have some time I could try adding a `How does it work` section.
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/pydockenv/commands/pydockenv.py#L32 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.
- Spivak 7y agoOnce I get my environment set up just the way I want in the container how do give it to someone else or make another one? Seems wild to pass around the actual container rather than an image that spawns your environment.
- se7entyse7en 7y agoTo share your environment with someone else you can run `pydockenv save` (see here: https://github.com/se7entyse7en/pydockenv/blob/master/pydockenv/commands/pydockenv.py#L98 https://github.com/se7entyse7en/pydockenv/blob/master/pydock...). I'm sorry that any example is present in the README so far. 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!