|
|
|
|
|
by vietjtnguyen
3202 days ago
|
|
I don't really work in this domain so maybe I'm missing something. If the goal is to essentially get the bare minimum needed to run a program into a Docker image why not develop your program in your desired environment and then use something like CDE [1] to copy (or obtain a list of) all the files touched in the desired invocation of the program. That copy or list can then be put into a tarball and imported with "docker import". Philip Guo even writes about this possible use [2]. Here's a silly example: cde python -c "import numpy as np; print(np.random.randn(3, 3).tolist())"
pushd cde-package/cde-root/; tar cavf ../../cde-image.tar *; popd
docker import cde-image.tar $USER:python-randn33
docker run $USER:python-randn33 python -c "import numpy as np; print(np.random.randn(3, 3).tolist())"
docker run -t -i $USER:python-randn33 python
If you look at the resulting "cde-image.tar" you'll find it to be quite bare. Mines had only 387 entries (files and folders).[1]: http://www.pgbovine.net/cde.html [2]: http://pgbovine.net/automatically-create-docker-images.htm |
|