Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-slim does not work with non root images #52

Closed
wzrdtales opened this issue Jun 2, 2018 · 4 comments
Closed

docker-slim does not work with non root images #52

wzrdtales opened this issue Jun 2, 2018 · 4 comments

Comments

@wzrdtales
Copy link

If you try running docker-slim on an image that does not use the root user it ends up throwing

time="2018-06-02T20:45:02Z" level=info msg="sensor: args => []string{"/opt/dockerslim/bin/sensor"}" 
time="2018-06-02T20:45:02Z" level=info msg="sensor: creating event publisher..." 
time="2018-06-02T20:45:02Z" level=info msg="sensor: creating cmd server..." 
time="2018-06-02T20:45:02Z" level=info msg="sensor: waiting for commands..." 
time="2018-06-02T20:45:02Z" level=info msg="sensor: monitor starting..." 
time="2018-06-02T20:45:02Z" level=info msg="fanmon: Run" 
time="2018-06-02T20:45:02Z" level=fatal msg="docker-slim: failure" error="operation not permitted" stack="goroutine 1 [running]:
runtime/debug.Stack(0xffffffffffffffff, 0x1, 0x5d7320)
	/usr/local/go/src/runtime/debug/stack.go:24 +0xa7
github.com/docker-slim/docker-slim/pkg/utils/errutils.FailOn(0x5d7320, 0xc42039c0d8)
	/Users/q/Desktop/ALL_DSLIM/BUG_DS_ISSUE_44/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/pkg/utils/errutils/errutils.go:14 +0x51
github.com/docker-slim/docker-slim/internal/app/sensor/monitors/fanotify.Run(0x5b61fa, 0x1, 0xc420380300, 0x1)
	/Users/q/Desktop/ALL_DSLIM/BUG_DS_ISSUE_44/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/internal/app/sensor/monitors/fanotify/monitor.go:38 +0x8f
github.com/docker-slim/docker-slim/internal/app/sensor.monitor(0xc4203a8000, 0xc420380240, 0xc420396180, 0xc4203a8070, 0xc4200104e0, 0xc42034a152, 0xa)
	/Users/q/Desktop/ALL_DSLIM/BUG_DS_ISSUE_44/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/internal/app/sensor/app.go:47 +0x122
github.com/docker-slim/docker-slim/internal/app/sensor.Run()
	/Users/q/Desktop/ALL_DSLIM/BUG_DS_ISSUE_44/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/internal/app/sensor/app.go:130 +0x4ec
main.main()
	/Users/q/Desktop/ALL_DSLIM/BUG_DS_ISSUE_44/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/cmd/docker-slim-sensor/main.go:8 +0x20
" version="linux|Tetra|latest|latest|latest (go1.10)" 

@maxmcd
Copy link

maxmcd commented Jun 15, 2018

This is covered in the readme: https://github.com/docker-slim/docker-slim#how-can-i-get-around-the-current-user-command-limitation

@kcq
Copy link
Member

kcq commented Aug 22, 2018

Thanks @maxmcd ! Yes, explicitly including the passwd file might help (e.g., docker-slim --http-probe --include-path /etc/passwd your-docker-image-name).

This could be a good enhancement to include /etc/passwd when there's a USER statement in the docker file.

@kcq
Copy link
Member

kcq commented Mar 13, 2019

The latast release ( https://github.com/docker-slim/docker-slim/releases/tag/1.24 ) added this capability. You can now use DockerSlim Docker images don't use the default user. Give it a try and let me know if you have any problems.

@kcq
Copy link
Member

kcq commented Mar 23, 2019

Closing it for now... Please reopen if you still see the same problem.

@kcq kcq closed this as completed Mar 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants