Persistent Isolated Development Environments
Use docker to create fully persistent and isolated development environments. Think virtualenv
from the python world, only for a whole system.
Installation
If you have rust + cargo installed: cargo install pide-rs
.
Binaries coming soon.
Dependencies
- docker (tested with v17.03)
Usage
First, create a dockerfile somewhere like ~/dockerfiles/debian-jessie-vim
. The contents should look something like this:
FROM debian:jessie
RUN apt-get update
RUN apt-get install -y \
vim
Next, move to the working directory of your project. Here I will use ~/demo
. Initialize pide
to your local working directory. This step may take some time, depending on how long it takes to build your dockerfile for the first time.
)
Now you have a persistent working environment! jump into it by calling pide resume
.
Note that the location you call pide resume
from is mapped as /host
in the docker environment. This is dangerous and bad. Be careful with this.
In this example, we created a file called hello_file
. If we resume again, it will still be there! This is also true for any system changes made, for example installing packages. Lets see what happens when we run it again:
|
Multiple Instances
If you re-use the same dockerfile in separate places, they will not interact with each other (though the init
stage will run much faster, as the original cached docker image is used). Example:
)
Using multiple dockerfiles in one working directory is not currently supported.
TODOs, Notes, Other
First of all, this is a really hacky tool meant to support my workflow. It should NOT be used for production, and may misbehave in any number of unsafe or dangerous ways. Use at your own risk.
Known issues/problems
- This will create a lot of orphaned docker images. This generally wastes space on your machine. From docker v1.13+, you can run
docker system prune
to clean up a bit. This is a bigger problem on Mac/Windows, where docker runs within a virtual machine with fairly limited total space. In those environments, I suggest using vagrant instead of this tool (you're running a VM anyway) - This tool maps your current working directory to docker. The root user can then do all sorts of bad things with UID 0, including making things executable, deleting the mapped directory, etc. Assume anything you do inside docker could have impact outside of docker. Use this only for dependency isolation, NOT security isolation
- Basically nothing is configurable yet. Eventually I would like to support more functionality from tools like
docker-compose
to map ports, volumes, networks, etc.
License
This tool is licensed under the MIT license.