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

2016-09-26 Thread Tomasz Czyż
Brian, thank you for explanation.

2016-09-26 11:13 GMT+01:00 Brian McKenna :

> Yes, it's "docker load" instead of "docker import"
>
> The escaping thing is due to jshon trying to support generating JSON
> which can be inserted into a  tag. It adds a backslash so that
> it never generates the string ""
>
> On 26/09/2016, Michael Fellinger  wrote:
> > Try using 'docker load -i' instead
> >
> > On Sun, Sep 25, 2016, 13:44 Tomasz Czyż  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/xx.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:41988742f842b9214b599674ccc7d3
> da9a0df5336276657cec1a9eabf1c297ef",
> >>  "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@lists.science.uu.nl
> >> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> >>
> >
>



-- 
Tomasz Czyż
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


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

2016-09-26 Thread Brian McKenna
Yes, it's "docker load" instead of "docker import"

The escaping thing is due to jshon trying to support generating JSON
which can be inserted into a  tag. It adds a backslash so that
it never generates the string ""

On 26/09/2016, Michael Fellinger  wrote:
> Try using 'docker load -i' instead
>
> On Sun, Sep 25, 2016, 13:44 Tomasz Czyż  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/xx.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@lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


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

2016-09-25 Thread Michael Fellinger
Try using 'docker load -i' instead

On Sun, Sep 25, 2016, 13:44 Tomasz Czyż  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/xx.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@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


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

2016-09-25 Thread Tomasz Czyż
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/xx.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@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev