Deploying reproducible, short-lived Debian development environments anywhere.
The current release of WSL and Mingw-w64 have strong limitations in terms of enabling me to develop on Windows 10, so I opted for deploying my development environments using Docker.
The benefits of this approach are:
| Property | Description |
|---|---|
| Cross-platform | Bring your dev environments to any hosts that have Docker installed. |
| Stability | Detect early if installing an update breaks your environment (CI/CD). |
| Security | Use short-lived environment instances; only add to Dockerfile.* the dependencies that you really need. |
| Provenance | If you know the date when you deployed an environment, you can retrieve the version of all the system dependencies used.* |
| Reproducibility | Deploy past versions of your environments. |
* Assumes that the latest version of the environment available at that time has been
deployed. The script debian.sh is provided to garantee that by running
docker-compose pull before deploying the environment selected.
Use the script debian.sh <environment> <version> to start the environment
that matches the name and version specified. The following commands are
equivalent.
./debian.sh user latest
./debian.sh user
It is recommended to add debian.sh to your PATH so you can run environments
from anywhere.
The value of <version> can be set to any git tags for which Docker images have
been successfully pushed to DockerHub. For example,
./debian.sh user 20200713
When using Git Bash on Windows 10, use the following command:
winpty bash debian.sh user 20200713
Press CTRL+P followed by CTRL+Q to detatch from the container. To attach to the running container:
docker attach <container_id>
Enter exit or press CTRL+C followed by CTRL+D to exit and stop the container.
Fork and clone this repository.
Update the environments or create new ones (Dockerfile.*).
Update docker-compose.yml to account for the updated/new environments.
Update the GitHub Action ci.yml.
tschaffter by your username.Update the content of the file VERSION.
Set the GitHub secret DOCKER_USERNAME and DOCKER_PASSWORD used in ci.yml
to the credentials of a DockerHub account (service/machine user suggested).
After committing the changes, tag the commit to create a release.
tag -a 20200713
git push origin 20200713
Run one of the environments once the GitHub Action ci.yml has successfully
completed.
$ ./debian.sh user
Pulling user ... done
Pulling docker ... done
tschaffter@user:~$
Thanks to Aaron Hayden (@ahayden) for sharing his repository that implements the approach this project is based on.
Content type
Image
Digest
Size
210.3 MB
Last updated
about 6 years ago
docker pull tschaffter/debian:docker-20200817