slimtoolkit / slimtoolkit/slim

build always return error="open slim.report.json: no such file or directory

Open
#715 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
23.4k
Forks
840
PR merge metrics
No merged PRs in 30d

Description

Expected Behavior

docker-slim build return 0

version: latest release

Actual Behavior

docker-slim build \

--http-probe=false
--continue-after=1
--include-bin=/bin/bash
--include-shell --include-oslibs-net --include-ssh-client
dmodeler:20240914

the output is:
cmd=build state=started
cmd=build info=params target.type='image' target.image='10.122.92.94/3dopen-private/nds3dmodeler:20240914' continue.mode='timeout' rt.as.user='true' keep.perms='true' tags='' image-build-engine='internal'
cmd=build state=image.inspection.start
cmd=build info=image id='sha256:b1f71d5cc16bf0397c252a509b23ef1e66ce0bd5edb95b7ee68cf742fc811a0e' size.bytes='4056190549' size.human='4.1 GB'
cmd=build info=image.stack index='0' name='10.122.92.94/dotnet/centos-stream-dotnet:stream9.8' id='sha256:36fe389a0b5d7c2c1f8a6944744b4a82b1786ce3d1df0ba70cad537a76fd3ae7'
cmd=build info=image.stack index='1' name='10.122.92.94/3dopen-private/nds3dmodeler:20240914' id='sha256:b1f71d5cc16bf0397c252a509b23ef1e66ce0bd5edb95b7ee68cf742fc811a0e'
cmd=build state=image.inspection.done
cmd=build state=container.inspection.start
cmd=build info=container id='8e767aa9eb69e2d439791a36b751095a2062cad7044b046e41e63dc62aff1790' status='created' name='slimk_1889964_20240918083627'
cmd=build info=container status='running' name='slimk_1889964_20240918083627' id='8e767aa9eb69e2d439791a36b751095a2062cad7044b046e41e63dc62aff1790'
cmd=build info=container message='obtained IP address' ip='172.17.0.2'
cmd=build info=cmd.startmonitor status='sent'
cmd=build info=event.startmonitor.done status='received'
cmd=build info=container target.port.info='' message='YOU CAN USE THESE PORTS TO INTERACT WITH THE CONTAINER' name='slimk_1889964_20240918083627' id='8e767aa9eb69e2d439791a36b751095a2062cad7044b046e41e63dc62aff1790' target.port.list=''
cmd=build info=continue.after message='no input required, execution will resume after the timeout' mode='timeout'
cmd=build prompt='waiting for the target container (1 seconds)'
cmd=build info=event message='done waiting for the target container'
cmd=build state=container.inspection.finishing
cmd=build state=container.inspection.artifact.processing
cmd=build state=container.inspection.done
cmd=build state=building message="building optimized image" engine=internal
cmd=build state=completed
cmd=build info=results status='MINIFIED' by='9.39X' size.original='4.1 GB' size.optimized='432 MB'
cmd=build info=results image-build-engine='internal' image.name='10.122.92.94/3dopen-private/nds3dmodeler.slim' image.size='432 MB' image.id='sha256:a9f87f955b9e6ac37dd9a9b88317ab5bf9fa1664d825882cc1df20bc9ac903d6' image.digest='sha256:b2dbd15c431a27a6c73d0c6ef406d2de59ba8b357f197569dc9889a2c76db1d8' has.data='true'
cmd=build info=results artifacts.location='/tmp/slim-state/.slim-state/images/b1f71d5cc16bf0397c252a509b23ef1e66ce0bd5edb95b7ee68cf742fc811a0e/artifacts'
cmd=build info=results artifacts.report='creport.json'
cmd=build info=results artifacts.dockerfile.reversed='Dockerfile.reversed'
cmd=build info=results artifacts.seccomp='10.122.92.94-3dopen-private-nds3dmodeler-seccomp.json'
cmd=build info=results artifacts.apparmor='10.122.92.94-3dopen-private-nds3dmodeler-apparmor-profile'
cmd=build state=done
cmd=build info=commands message='use the xray command to learn more about the optimize image'
time="2024-09-18T16:36:37+08:00" level=fatal msg="slim: failure" error="open slim.report.json: no such file or directory" stack="goroutine 1 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x5e\ngithub.com/slimtoolkit/slim/pkg/util/errutil.FailOn({0x2328f40, 0xc000978570})\n\tgithub.com/slimtoolkit/slim/pkg/util/errutil/errutil.go:32 +0x4b\ngithub.com/slimtoolkit/slim/pkg/report.(*Command).saveInfo(0xc000097c00, {0x1d73020, 0xc000097c00})\n\tgithub.com/slimtoolkit/slim/pkg/report/command_report.go:559 +0x41b\ngithub.com/slimtoolkit/slim/pkg/report.(*BuildCommand).Save(...)\n\tgithub.com/slimtoolkit/slim/pkg/report/command_report.go:573\ngithub.com/slimtoolkit/slim/pkg/app/master/command/build.finishCommand(0xc00039cd20, {0xc00071c000, 0x2d}, {0x0, 0x0}, 0x0, {0x0, 0x0}, {0xc0000f0007, 0x40}, ...)\n\tgithub.com/slimtoolkit/slim/pkg/app/master/command/build/handler.go:1703 +0x1d08\ngithub.com/slimtoolkit/slim/pkg/app/master/command/build.OnCommand(_, , {, _}, , {, }, {, _}, {0x0, ...}, ...)\n\tgithub.com/slimtoolkit/slim/pkg/app/master/command/build/handler.go:1245 +0x5385\ngithub.com/slimtoolkit/slim/pkg/app/master/command/build.glob..func1(0xc000698b80)\n\tgithub.com/slimtoolkit/slim/pkg/app/master/command/build/cli.go:760 +0x5d51\ngithub.com/urfave/cli/v2.(*Command).Run(0x33a7220, 0xc000698b80, {0xc0001a8780, 0x8, 0x8})\n\tgithub.com/urfave/cli/v2@v2.27.1/command.go:279 +0x9dd\ngithub.com/urfave/cli/v2.(*Command).Run(0xc0007134a0, 0xc000698140, {0xc000050120, 0x9, 0x9})\n\tgithub.com/urfave/cli/v2@v2.27.1/command.go:272 +0xc2e\ngithub.com/urfave/cli/v2.(*App).RunContext(0xc000150600, {0x23470c8?, 0x341e0a0}, {0xc000050120, 0x9, 0x9})\n\tgithub.com/urfave/cli/v2@v2.27.1/app.go:337 +0x5db\ngithub.com/urfave/cli/v2.(*App).Run(...)\n\tgithub.com/urfave/cli/v2@v2.27.1/app.go:311\ngithub.com/slimtoolkit/slim/pkg/app/master.Run()\n\tgithub.com/slimtoolkit/slim/pkg/app/master/app.go:15 +0x45\nmain.main()\n\tgithub.com/slimtoolkit/slim/cmd/slim/main.go:15 +0x187\n" version="linux/amd64|Transformer|1.40.11|1b271555882eacdfb4e6598d6d0552e9b9b1449b|2024-02-02_01:36:22PM"
[root@localhost logs]# echo $?
1
how to resolve this issue?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pkg/report/command_report.go at saveInfo (line 559), then trace the build completion path in pkg/app/master/command/build/handler.go around finishCommand (line 1703). Reproduce the docker-slim build command and inspect why saving the report expects slim.report.json after the build reports completion. Done means the command exits successfully and the expected report is saved.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.