Implementation of POST /images/load endpoint by leonsabr · Pull Request #627 · docker-java/docker-java
In order to get this tarball I manually did the following:
- Created a simple Dockerfile which produces a 2-layer image.
docker build -t docker-java/load:1.0 .docker save docker-java/load:1.0 > image.tar
As I see, Docker guys have tarballs in repository:
$ find docker -type f -name "*.tar"
docker/integration-cli/fixtures/load/emptyLayer.tar
docker/pkg/archive/testdata/broken.tar
docker/pkg/tarsum/testdata/46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457/layer.tar
docker/pkg/tarsum/testdata/511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/layer.tar
docker/pkg/tarsum/testdata/collision/collision-0.tar
docker/pkg/tarsum/testdata/collision/collision-1.tar
docker/pkg/tarsum/testdata/collision/collision-2.tar
docker/pkg/tarsum/testdata/collision/collision-3.tar
docker/pkg/tarsum/testdata/xattr/layer.tar
As I understand you suggest to have text files in resources, then in runtime create a tarball according to format? It is tricky because tarball contains layer tarballs inside. So you need to create correct layer tarballs, then put them in the image tarball.
By the way, I can do a smaller tarball, with one layer, a few kB.