clairctl icon indicating copy to clipboard operation
clairctl copied to clipboard

Local mode gets file path confused

Open donbowman opened this issue 7 years ago • 0 comments

dump.pcap.gz strace -f -e file clairctl analyze -l --log-level debug group/container:hash

writes to /tmp/clairctl/group/container/blobs/hash/layer.tar

But the read-back comes from: [pid 157] openat(AT_FDCWD, "/tmp/clairctl/docker.io/group/container/blobs/hash/layer.tar", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

e.g. docker.io got inserted.

I'm not clear why, on the below (from clairctl analyze -l --log-level debug group/container:tag) I get a 'https://registry-1.docker.io/v2' output.

2018-07-05 17:20:46.497510 D | config: Using config file: /root/.clairctl/clairctl.yaml
2018-07-05 17:20:46.497883 D | dockercli: docker image to save: group/container:tag
2018-07-05 17:20:46.497897 D | dockercli: saving in: /tmp/clairctl/group/container/blobs
2018-07-05 17:20:47.919113 I | config: retrieving interface for local IP
2018-07-05 17:20:47.919148 D | config: interface provided, looking for eth0
2018-07-05 17:20:47.919942 I | server: Starting Server on 10.16.1.175:37888
2018-07-05 17:20:47.925375 I | config: retrieving interface for local IP
2018-07-05 17:20:47.925402 D | config: interface provided, looking for eth0
2018-07-05 17:20:47.925527 I | clair: using http://10.16.1.175:37888/local as local url
2018-07-05 17:20:47.925540 I | clair: Pushing Layer 1/1 [74fe78893638]
2018-07-05 17:20:47.925615 D | clair: Saving 74fe78893638ede16ca5550eebc360fbb40ff6232330376693ada97d948ad75f[https://registry-1.docker.io/v2]
2018-07-05 17:20:47.995326 I | clair: adding layer 1/1 [74fe78893638]: receiving http error: 400
client quit unexpectedly
2018-07-05 17:20:47.995366 C | cmd: pushing image "group/container:tag": receiving http error: 400

a packet capture is attached. port 37888 is the 'local' port of cairctl:

{"Layer":{"Name":"4f220f2aa3577047e7ca4f782d2bef57a7b58f0d73804559219bcc224e1099ad","Path":"http://10.16.1.175:37888/local/docker.io/library/openjdk/blobs/4f220f2aa3577047e7ca4f782d2bef57a7b58f0d73804559219bcc224e1099ad/layer.tar","Format":"Docker"}}

donbowman avatar Jul 05 '18 17:07 donbowman