slimtoolkit / slimtoolkit/slim

"OCI runtime create failed" when building on M1 Mac

Open
#275 5 comments 11 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 builds the specified image.


Actual Behavior

$ docker-slim build ubuntu:focal

docker-slim: message='join the Gitter channel to ask questions or to share your feedback' info='https://gitter.im/docker-slim/community'
docker-slim: message='join the Discord server to ask questions or to share your feedback' info='https://discord.gg/9tDyxYS'
docker-slim: message='Github discussions' info='https://github.com/docker-slim/docker-slim/discussions'
cmd=build info=param.http.probe message='using default probe' 
cmd=build state=started
cmd=build info=params rt.as.user='true' keep.perms='true' tags='' target.type='image' target='ubuntu:focal' continue.mode='probe' 
cmd=build state=image.inspection.start
cmd=build info=image id='sha256:9f4877540c734dfd8ee2e523b1487788f871e64a4f3137797d33e5971ac9adde' size.bytes='65593527' size.human='66 MB' 
cmd=build info=image.stack index='0' name='ubuntu:focal' id='sha256:9f4877540c734dfd8ee2e523b1487788f871e64a4f3137797d33e5971ac9adde' 
cmd=build state=image.inspection.done
cmd=build state=container.inspection.start
cmd=build info=container status='created' name='dockerslimk_17717_20220119035505' id='90f636f95a7121ba5ccfad6d5a90900709f8b653ba25b62b7951dcbd9497812c' 
time="2022-01-18T22:55:05-05:00" level=fatal msg="docker-slim: failure" error="API error (400): OCI runtime create failed: container_linux.go:380: starting container process caused: exec: \"/opt/dockerslim/bin/docker-slim-sensor\": stat /opt/dockerslim/bin/docker-slim-sensor: no such file or directory: unknown" stack="goroutine 1 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x88\ngithub.com/docker-slim/docker-slim/pkg/util/errutil.FailOn({0x102b5f960, 0x1400048c030})\n\tgithub.com/docker-slim/docker-slim/pkg/util/errutil/errutil.go:28 +0x30\ngithub.com/docker-slim/docker-slim/pkg/app.(*ExecutionContext).FailOn(0x1400013e260, {0x102b5f960, 0x1400048c030})\n\tgithub.com/docker-slim/docker-slim/pkg/app/execontext.go:43 +0x44\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.OnCommand(0x1400013e260, 0x1400010c2d0, {0x16dc67ac2, 0xc}, 0x0, {0x0, 0x0}, {0x0, 0x0}, {0x0, ...}, ...)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/handler.go:893 +0x4f54\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.glob..func1(0x140001b0160)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/cli.go:629 +0x4210\ngithub.com/urfave/cli.HandleAction({0x102a41c60, 0x102b53148}, 0x140001b0160)\n\tgithub.com/urfave/cli@v1.22.4/app.go:526 +0xfc\ngithub.com/urfave/cli.Command.Run({{0x102883331, 0x5}, {0x0, 0x0}, {0x1030f2c90, 0x1, 0x1}, {0x1028bdcb4, 0x6c}, {0x0, ...}, ...}, ...)\n\tgithub.com/urfave/cli@v1.22.4/command.go:174 +0x610\ngithub.com/urfave/cli.(*App).Run(0x140000321c0, {0x1400011c090, 0x3, 0x3})\n\tgithub.com/urfave/cli@v1.22.4/app.go:279 +0x6e8\ngithub.com/docker-slim/docker-slim/pkg/app/master.Run()\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/app.go:15 +0x48\nmain.main()\n\tgithub.com/docker-slim/docker-slim/cmd/docker-slim/main.go:8 +0x20\n" version="darwin|Transformer|1.37.3|latest|latest"

Steps to Reproduce the Problem

  1. Install docker-slim 1.37.3 via Homebrew:
$ brew install docker-slim

...

$ brew info docker-slim

docker-slim: stable 1.37.3 (bottled)
Minify and secure Docker images
https://dockersl.im
/opt/homebrew/Cellar/docker-slim/1.37.3 (7 files, 23MB) *
  Poured from bottle on 2022-01-18 at 22:25:18
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/docker-slim.rb
License: Apache-2.0
  1. Pull a Docker image from registry (i.e. ubuntu:focal):

  2. Attempt to build Docker image using docker-slim:

$ docker-slim build ubuntu:focal

Specifications

  • Version: 1.37.3
  • Platform: MacBook Pro (13-inch, M1, 2020), macOS Monterey 12.1

Additional Info

Binary locations:

$ which docker-slim
/opt/homebrew/bin/docker-slim

$ which docker-slim-sensor 
/opt/homebrew/bin/docker-slim-sensor

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 the failing build path in pkg/app/master/commands/build/handler.go around line 893 and compare it with the installed docker-slim and docker-slim-sensor locations reported in the issue. Reproduce on an M1 Mac with docker-slim 1.37.3 and inspect how the sensor is made available to the container. Done means docker-slim build ubuntu:focal starts successfully without the missing-sensor error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.