[Nix-dev] docker import ignores dockerTools.buildImage config

Michael Fellinger m.fellinger at gmail.com
Sun Sep 25 16:13:25 CEST 2016


Try using 'docker load -i' instead

On Sun, Sep 25, 2016, 13:44 Tomasz Czyż <tomasz.czyz at gmail.com> wrote:

> Hi,
>
> I'm preparing docker image using dockerTools.buildImage with
>
>       x = pkgs.dockerTools.buildImage {name="myimage";·
>
>         contents = [dumb-init ];
>
>         config={
>
>           WorkingDir = "/";
>
>         };
>
>      };
>
> After the image is ready I do
>
> docker import /nix/store/xxxxxx.tar.gz myimage
> and I have the image imported but
>
> docker inspect myimage
>
>         "Config": {
>             "Hostname": "",
>             "Domainname": "",
>             "User": "",
>             "AttachStdin": false,
>             "AttachStdout": false,
>             "AttachStderr": false,
>             "Tty": false,
>             "OpenStdin": false,
>             "StdinOnce": false,
>             "Env": null,
>             "Cmd": null,
>             "Image": "",
>             "Volumes": null,
>             "WorkingDir": "",
>             "Entrypoint": null,
>             "OnBuild": null,
>             "Labels": null
>         },
>
> inside the tar file I have the config like:
>
> {
>  "architecture": "amd64",
>  "config": {
>   "WorkingDir": "\/"
>  },
>  "created": "1970-01-01T00:00:01Z",
>  "os": "linux",
>  "checksum":
> "tarsum.v1+sha256:41988742f842b9214b599674ccc7d3da9a0df5336276657cec1a9eabf1c297ef",
>  "id": "9edfe86ac62fc829c5a122778565e3af12ce720dd64ca6547c6664e671996c63",
>  "Size": 22067200
> }
>
> So as you can see, the json config is generated inside docker image, but
> docker does not import that settings. Also it looks like it's escaped but
> it should not be right?
>
> Does anyone knows how to do it properly or tell how I could fix it?
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160925/9ccdd2f7/attachment.html>


More information about the nix-dev mailing list