slim: SensorError Fanotify function not implemented

Expected Behavior

Call docker-slim and receive a slimified image on Windows docker-desktop similar to linux based docker.


Actual Behavior

docker-slim[build]: info=http.probe message='using default probe'
cmd=build state=started
cmd=build info=params target=discordbot continue.mode=probe rt.as.user=true keep.perms=true
cmd=build state=image.inspection.start
cmd=build info=image id=sha256:d9ba3a051c03fb116888b6cf2838c7a56baaea954708e49311ff79286ea0c099 size.bytes=857306452 size.human=857 MB
cmd=build info=image.stack index=0 name='discordbot:latest' id='sha256:d9ba3a051c03fb116888b6cf2838c7a56baaea954708e49311ff79286ea0c099'
cmd=build state=image.inspection.done
cmd=build state=container.inspection.start
cmd=build info=container status=created name=dockerslimk_9304_20210207113908 id=c958ce4f41bf12268c2b48e1be2353a1238ce985bc63213aa9734f874a9d57e3
cmd=build info=cmd.startmonitor status=sent
cmd=build info=event.error status=received data=SensorError{Op:sensor.fanotify.Run/fanapi.Initialize,Kind:call.error,Wrapped:{Type=syscall.Errno,Info=function not implemented,Line:43,File:github.com/docker-slim/docker-slim/internal/app/sensor/monitors/fanotify/monitor.go}}
cmd=build state=exited version=linux|Transformer|1.34.0|a5cb54043b3ab3cf747165aad745f19db680434e|2021-01-29_10:00:49PM

Steps to Reproduce the Problem

  1. Have image locally
docker image ls discordbot
REPOSITORY   TAG       IMAGE ID       CREATED      SIZE
discordbot   latest    d9ba3a051c03   7 days ago   857MB
  1. Execute docker-slim --log-level debug --log-format json --log slim.log build discordbot
$ docker-slim --log-level debug --log-format json --log slim.log build discordbot
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'
docker-slim[build]: info=http.probe message='using default probe'
cmd=build state=started
cmd=build info=params target=discordbot continue.mode=probe rt.as.user=true keep.perms=true
cmd=build state=image.inspection.start
cmd=build info=image id=sha256:d9ba3a051c03fb116888b6cf2838c7a56baaea954708e49311ff79286ea0c099 size.bytes=857306452 size.human=857 MB
cmd=build info=image.stack index=0 name='discordbot:latest' id='sha256:d9ba3a051c03fb116888b6cf2838c7a56baaea954708e49311ff79286ea0c099'
cmd=build state=image.inspection.done
cmd=build state=container.inspection.start
cmd=build info=container status=created name=dockerslimk_9326_20210207113938 id=3b0ffde05cdd4d480c16b9e94091e0c48d38eeb65bf637f8a6da837b4dbb792e
cmd=build info=cmd.startmonitor status=sent
cmd=build info=event.error status=received data=SensorError{Op:sensor.fanotify.Run/fanapi.Initialize,Kind:call.error,Wrapped:{Type=syscall.Errno,Info=function not implemented,Line:43,File:github.com/docker-slim/docker-slim/internal/app/sensor/monitors/fanotify/monitor.go}}
cmd=build state=exited version=linux|Transformer|1.34.0|a5cb54043b3ab3cf747165aad745f19db680434e|2021-01-29_10:00:49PM

Specifications

$ docker-slim version
cmd=version info=app version='linux|Transformer|1.34.0|a5cb54043b3ab3cf747165aad745f19db680434e|2021-01-29_10:00:49PM' container=false dsimage=false
cmd=version info=app outdated=false current=1.34.0 verdict='your have the latest version'
cmd=version info=app location='/home/aymon/.local/bin'
cmd=version info=host osname='Ubuntu 20.04.2 LTS (Focal Fossa)'
cmd=version info=host osbuild=
cmd=version info=host version='#1 SMP Tue Jun 23 12:58:10 UTC 2020'
cmd=version info=host release=4.19.128-microsoft-standard
cmd=version info=host sysname=Linux
cmd=version info=docker name=docker-desktop
cmd=version info=docker kernel_version=4.19.128-microsoft-standard
cmd=version info=docker operating_system=Docker Desktop
cmd=version info=docker ostype=linux
cmd=version info=docker server_version=20.10.2
cmd=version info=docker architecture=x86_64
cmd=version info=dclient api_version=1.41
cmd=version info=dclient min_api_version=1.12
cmd=version info=dclient build_time=2020-12-28T16:15:28.000000000+00:00
cmd=version info=dclient git_commit=8891c58
Server: Docker Engine - Community
 Engine:
  Version:          20.10.2
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8891c58
  Built:            Mon Dec 28 16:15:28 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 25 (8 by maintainers)

Most upvoted comments

It will be possible to disable the fanotify source soon (WIP)

Hey @kcq, just wanted to check in on this as I’m hitting the same issue.

Facing same problem, by checking the host device system, it seem that some distros like alpine do not have fanotify support in kernel by default (as you can check by cat /boot/config-<kernel_version> | grep FANOTIFY) and leading to this error. Currently my solution is to use a VM of unbuntu (or any other distro with fanotify) to run docker-slim. Since docker-slim use fanotify only trace the file accessed, it might be possible to use inotify as an fallback replacement, which is more widely supported.

Disabling the fanotify data source is going to be the easiest route (inotify isn’t quite the same). It’s not exposed with a flag yet, but it should be possible.

@kcq How to disable the fanotify data source and what’s the implication or potential impact on the build? or this is just used for internal notification?

It will be possible to disable the fanotify source soon (WIP)

@pavankumar-go What is the image you are trying to minify? Is this an arm64 container image? Usually you get this when there’s no arm64 version and you end up with the amd64 version and the way those images are executed on M1 has limitiations in terms of what system/kernel capabilities are available in the emulation mode they use.

Same here on MacOS 12.2.1

Hello, I seem to have the same error running docker-slim on mac os 12.1

docker-slim build sev2                                                                                                                                                      I 
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 target.type='image' target='sev2' continue.mode='probe' rt.as.user='true' keep.perms='true' tags='' 
cmd=build state=image.inspection.start
cmd=build info=image id='sha256:43caf14b3756d0e9a4b987a86785ca1dedd40e6cb7809966e765d36521c1069d' size.bytes='2114762232' size.human='2.1 GB' 
cmd=build info=image.stack id='sha256:28a4c88cdbbf27e06dc5dc6784504d6536e8678284d84dd7f88f95b2145d27b0' index='0' name='python:3.8.5' 
cmd=build info=image.stack index='1' name='sev2:latest' id='sha256:43caf14b3756d0e9a4b987a86785ca1dedd40e6cb7809966e765d36521c1069d' 
cmd=build state=image.inspection.done
cmd=build state=container.inspection.start
cmd=build info=container status='created' name='dockerslimk_3603_20220214080729' id='a1410867ed44b7ccbdd45a24d914059d0f3bd963ed0ece56b0cdb810f7bd82b5' 
cmd=build info=cmd.startmonitor status='sent' 
cmd=build info=event.error status='received' data='SensorError{Op:sensor.fanotify.Run/fanapi.Initialize,Kind:call.error,Wrapped:{Type=syscall.Errno,Info=function not implemented,Line:43,File:github.com/docker-slim/docker-slim/pkg/app/sensor/monitors/fanotify/monitor.go}}' 
cmd=build state=exited code=-124 component=container.inspector version=darwin|Transformer|1.37.3|latest|latest 

Version

cmd=version info=app version='darwin|Transformer|1.37.3|latest|latest' container=false dsimage=false
cmd=version info=app outdated=false current=1.37.3 verdict='you have the latest version'
cmd=version info=app location='/usr/local/bin'
cmd=version info=host osname='other'
cmd=version info=host osbuild=21C52
cmd=version info=host version=' Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64'
cmd=version info=host release=21.2.0
cmd=version info=host sysname=darwin
cmd=version info=docker name=minikube
cmd=version info=docker kernel_version=4.19.202
cmd=version info=docker operating_system=Buildroot 2021.02.4
cmd=version info=docker ostype=linux
cmd=version info=docker server_version=20.10.8
cmd=version info=docker architecture=x86_64
cmd=version info=dclient api_version=1.41
cmd=version info=dclient min_api_version=1.12
cmd=version info=dclient build_time=2021-07-30T19:55:09.000000000+00:00
cmd=version info=dclient git_commit=75249d8
``