slimtoolkit / slim

Slim(toolkit): Don't change anything in your container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)
Apache License 2.0
19.19k stars 715 forks source link

XRay works, but build fails with EOF error #141

Open Ranbato opened 4 years ago

Ranbato commented 4 years ago

Image marklambert/nextpvr-ccextractor

This image will eventually fail for other reasons because it uses .NET runtime, but this analysis failure should probably be looked at separately.

mark@Storage:~/docker-slim/dist_linux$ ./docker-slim build marklambert/nextpvr-ccextractor docker-slim[build]: info=http.probe message='using default probe' docker-slim[build]: state=started docker-slim[build]: info=params target=marklambert/nextpvr-ccextractor continue.mode=probe rt.as.user=true keep.perms=true docker-slim[build]: state=image.inspection.start docker-slim[build]: info=image id=sha256:9376732854714babe0f3efd7ec7f2f69c1e68a02315a700cbdb74b9fdfd43b0d size.bytes=594633103 size.human=595 MB docker-slim[build]: info=image.stack index=0 name='nextpvr/nextpvr_amd64:stable' id='sha256:567d433cd7009f51107d5fb1743bb54ee38e468be13e9a730c168a6461c72f75' docker-slim[build]: info=image.stack index=1 name='marklambert/nextpvr-ccextractor:latest' id='sha256:9376732854714babe0f3efd7ec7f2f69c1e68a02315a700cbdb74b9fdfd43b0d' docker-slim[build]: info=image.exposed_ports list='80,443' docker-slim[build]: state=image.inspection.done docker-slim[build]: state=container.inspection.start time="2020-04-05T09:05:50-06:00" level=error msg="dockerutil.BuildEmptyImage: dockerapi.BuildImage() error = unexpected EOF" time="2020-04-05T09:05:50-06:00" level=fatal msg="docker-slim: failure" error="unexpected EOF" stack="goroutine 1 [running]:\nruntime/debug.Stack(0x0, 0x0, 0x0)\n\truntime/debug/stack.go:24 +0x9d\ngithub.com/docker-slim/docker-slim/pkg/util/errutil.FailOn(0xb9ab20, 0xc000104060)\n\tgithub.com/docker-slim/docker-slim/pkg/util/errutil/errutil.go:14 +0x54\ngithub.com/docker-slim/docker-slim/internal/app/master/inspectors/container.(*Inspector).RunContainer(0xc0000f21e0, 0x4, 0xc000279f98)\n\tgithub.com/docker-slim/docker-slim/internal/app/master/inspectors/container/container_inspector.go:255 +0x339c\ngithub.com/docker-slim/docker-slim/internal/app/master/commands.OnBuild(0xc00007e050, 0x7ffdfc6b9d9e, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xaa2d01, ...)\n\tgithub.com/docker-slim/docker-slim/internal/app/master/commands/build.go:263 +0x1617\ngithub.com/docker-slim/docker-slim/internal/app/master.init.0.func10(0xc00007c160, 0x0, 0xc000302300)\n\tgithub.com/docker-slim/docker-slim/internal/app/master/cli.go:1655 +0x171a\ngithub.com/urfave/cli.HandleAction(0x9cd840, 0xad0bd8, 0xc00007c160, 0xc00007c160, 0x0)\n\tgithub.com/urfave/cli@v1.22.1/app.go:523 +0x11a\ngithub.com/urfave/cli.Command.Run(0xaa0a83, 0x5, 0x0, 0x0, 0xc00026ad40, 0x1, 0x1, 0xac41f6, 0x3e, 0x0, ...)\n\tgithub.com/urfave/cli@v1.22.1/command.go:174 +0x56e\ngithub.com/urfave/cli.(*App).Run(0xc000290000, 0xc00018c000, 0x3, 0x3, 0x0, 0x0)\n\tgithub.com/urfave/cli@v1.22.1/app.go:276 +0x7ae\ngithub.com/docker-slim/docker-slim/internal/app/master.runCli()\n\tgithub.com/docker-slim/docker-slim/internal/app/master/cli.go:2053 +0x55\ngithub.com/docker-slim/docker-slim/internal/app/master.Run()\n\tgithub.com/docker-slim/docker-slim/internal/app/master/app.go:6 +0x25\nmain.main()\n\tgithub.com/docker-slim/docker-slim/cmd/docker-slim/main.go:8 +0x20\n" version="linux|Transformer|1.29.0|afff2c9679a697ebfc933360267253a10325269d|2020-03-18_07:11:20PM"

kcq commented 4 years ago

Thanks for opening the issue @Ranbato ! This is a strange error... Building an empty image fails with the 'unexpected EOF' error... What version of Docker do you have? What linux distro/version are you using for the host? I'll try to repro the condition...

Speaking of the xray command... What kind of info were you looking for? Is there's more you'd like to see?

Ranbato commented 4 years ago

I'm running Docker on my NAS so hopefully you can reproduce without the specific version of Linux.

Linux Storage 4.4.59+ #24922 SMP PREEMPT Mon Aug 19 12:13:37 CST 2019 x86_64 GNU/Linux synology_apollolake_918+ Docker version 18.09.8, build 2c0a67b

I wasn't looking for anything specific using xray, just trying to narrow down where the error was occurring. If you can't reproduce from the above image, I can also attach the Dockerfile to see if that makes a difference.

kcq commented 4 years ago

@Ranbato thanks for the Docker version info! Yes, it'll be pretty helpful if you could share the Dockerfile

Ranbato commented 4 years ago

Here is the Dockerfile

Dockerfile.txt