Open ghost opened 8 years ago
Thank you for the report! Can you share the command line parameters for the 'docker-slim build' command? It looks like you didn't specify any parameters for the container. Normally it's not a big deal because there's a default thanks to the CMD Docker file instruction, but daly/axiom is different and its Dockerfile doesn't have that instruction: https://github.com/daly/axiom/blob/master/Dockerfile . Next version of DockerSlim will correctly detect this condition (when images don't specify ENTRYPOINT/CMD and docker-slim build calls don't have that information either). Either way, your command should look something like this: docker-slim build --cmd axiom daly/axiom
.
Thank you for your reply! I did not use any command line parameters other than --http-probe
(even though it still did not work). Actually I am not sure what option should I use. I met a personality change failure 1
problem when running daly/axiom
. According to this issue, most uses of personality are blocked. I am not sure how to use docker-slim build
to avoid this. Could you please give me a hint?
The docker info api is no longer compatible.
Older versions contain the ports in NetworkSettings
:
{
"NetworkSettings":{"Bridge":"","SandboxID":"85e398b23c6a8edce07e30e60672513c3f754eea5ae2a2febdd1d05647a42f13","HairpinMode":false,"LinkLocalIPv6Address":"","LinkLocalIPv6PrefixLen":0,"Ports":{"65501/tcp":[{"HostIp":"0.0.0.0","HostPort":"32775"}],"65502/tcp":[{"Host
Ip":"0.0.0.0","HostPort":"32774"}],"80/tcp":[{"HostIp":"0.0.0.0","HostPort":"32776"}]}
}
Those fields are no longer present.
ok. The problem was actually a different one. I and @Nil-Zil built our docker-slim-sensor
plugin on nixos instead of using the provided executables:
ldd ~/go/bin/docker-slim-sensor
linux-vdso.so.1 (0x00007ffdec332000)
libpthread.so.0 => /nix/store/z0b60y0khix9jb74ka56gw7b7n9s8awx-glibc-2.26-131/lib/libpthread.so.0 (0x00007f464556a000)
libc.so.6 => /nix/store/z0b60y0khix9jb74ka56gw7b7n9s8awx-glibc-2.26-131/lib/libc.so.6 (0x00007f46451b8000)
/nix/store/dps6gpjd9vmjylqgjhdbw6kyxfbfssn7-glibc-2.26-75/lib/ld-linux-x86-64.so.2 => /nix/store/z0b60y0khix9jb74ka56gw7b7n9s8awx-glibc-2.26-131/lib64/ld-linux-x86-64.so.2 (0x00007f4645788000)
binaries are therefore linked against libc in nix store, that does not exists in the container.
My workaround was to add a bind mount for /nix/
in docker-slim
:
diff --git a/internal/app/master/inspectors/container/container_inspector.go b/internal/app/master/inspectors/container/container_inspector.go
index 7b89f57..3aa542a 100644
--- a/internal/app/master/inspectors/container/container_inspector.go
+++ b/internal/app/master/inspectors/container/container_inspector.go
@@ -125,6 +125,7 @@ func (i *Inspector) RunContainer() error {
volumeBinds = append(volumeBinds, artifactsMountInfo)
volumeBinds = append(volumeBinds, sensorMountInfo)
+ volumeBinds = append(volumeBinds, "/nix:/nix:ro")
var containerCmd []string
if i.DoDebug {
Using the static binary would also work.
I would not consider this a bug in docker-slim
itself.
I had the image daly/axiom installed
by
docker pull daly/axiom
. But I could not run it on Mac because this issue, so I wanted to modify its Seccomp profiles. And when I ran./docker-slim build daly/axiom
I got the following message:But I had other images, like
nilqed/fricas_jupyter
or officialubuntu
image, their images were built successfully bydocker-slim
. I want to know whydaly/axiom
cannot be built.Other info:
./docker-slim --version
docker --version
And I did not install
go
. If there is any other information I have not supplied, please tell me. Thank you!