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

Add the --no-pivot flag to the run command #1071

Closed
wants to merge 3 commits into from

Conversation

afbjorklund
Copy link
Contributor

--no-pivot: "do not use pivot root to jail process inside rootfs.
This should be used whenever the rootfs is on top of a ramdisk"

This is used in minikube, currently with $DOCKER_RAMDISK
(but I'm not sure if this clients wants to honor that env variable...)

afbjorklund added a commit to afbjorklund/minikube that referenced this pull request Oct 5, 2018
@rh-atomic-bot
Copy link
Collaborator

Can one of the admins verify this patch?
I understand the following commands:

  • bot, add author to whitelist
  • bot, test pull request
  • bot, test pull request once

@TomSweeneyRedHat
Copy link
Member

bot, add author to whitelist

@TomSweeneyRedHat
Copy link
Member

If this goes through, we'll need some updates to the man page and a test or two would probably be good. However it looked like @nalind and @giuseppe thought this should be removed and it was in #921. Gents WDYT?

@afbjorklund
Copy link
Contributor Author

@TomSweeneyRedHat:
It is the same runc run flag (without the "root"), but it is used for a different purpose.
WIthout avoiding pivot_root(2), it is not possible to run containers from a tmpfs root...

Either with docker run:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:107: jailing process inside rootfs caused \\\"pivot_root invalid argument\\\"\"": unknown.

Or with buildah run:
container_linux.go:296: starting container process caused "process_linux.go:398: container init caused \"rootfs_linux.go:107: jailing process inside rootfs caused \\\"pivot_root invalid argument\\\"\"" error running container: error creating container for [/bin/sh]: : exit status 1

This implementation uses a parameter, which means that it is all pushed on the user. :-(
The docker daemon has an environment line in the systemd service, so it "just works":

https://github.com/kubernetes/minikube/blob/master/pkg/provision/buildroot.go#L79:L80

We have the same thing for crio, but yet no global configuration for podman and buildah.
But apparently there is a (correctly spelled) "no_pivot_root" option in libpod.conf already ?

https://github.com/kubernetes/minikube/blob/master/deploy/iso/minikube-iso/package/crio-bin/crio.conf#L70:L71


Currently there is a little bit of struggle left, getting the new images "all the way" to cri-o/k8s.

But that's mostly config issues like "overlay" vs "overlay2", or mounting /var/lib/containers...

The ways of working is not yet set, for now minikube docker-env is replaced with minikube ssh :

https://kubernetes.io/docs/setup/minikube/#reusing-the-docker-daemon (--> running buildah on VM)

@afbjorklund
Copy link
Contributor Author

What is a DCO ? (Travis failure)

@TomSweeneyRedHat
Copy link
Member

@afbjorklund the DCO is due to the commit not being signed, sorry, didn't spot that last night. You'll need to do:
git commit --amend -s and then repush. That should clear that up.

--no-pivot: "do not use pivot root to jail process inside rootfs.
  This should be used whenever the rootfs is on top of a ramdisk"

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
@afbjorklund
Copy link
Contributor Author

Weird that such a thing should break the build, but whatever. Signed off the commit...

@TomSweeneyRedHat
Copy link
Member

Test failure due to a network flake talking to the registry, going to retest.

@TomSweeneyRedHat
Copy link
Member

bot, retest this please.

@TomSweeneyRedHat
Copy link
Member

@afbjorklund TYVM for the background info btb.

@rhatdan
Copy link
Member

rhatdan commented Oct 7, 2018

@afbjorklund We need modifications to the man pages and command completions. I agree we need @giuseppe and @nalind To approve.

@afbjorklund
Copy link
Contributor Author

I can do the man pages and bash completions, just wanted some feedback if we should add an environment variable so that it can be configured once and transparently ? And the name of it, if so...

Basically it would be nice if the user could just use buildah and not worry about it (i.e. --no-pivot). A global configuration option would also work, like we already are doing for e.g. /etc/crictl.yaml

@rhatdan
Copy link
Member

rhatdan commented Oct 7, 2018

@afbjorklund We are doing config via environment variables, since we are trying to avoid config files, for now. BUILDAH_NOPIVOT would be my pick.

@afbjorklund
Copy link
Contributor Author

Thanks. I guess we could set this in /etc/environment or something, to make it globally available.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
@afbjorklund
Copy link
Contributor Author

Make that /etc/profile.d/buildah.sh, I don't think that it reads from /etc/environment

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
@rhatdan
Copy link
Member

rhatdan commented Oct 12, 2018

@afbjorklund Looks like @nalind Removed --no-pivot-root in f941593

@afbjorklund
Copy link
Contributor Author

Yeah, I noticed that - but I think it was for a different reason ? (rootless rather than tmpfs)

@giuseppe
Copy link
Member

the --no-pivot flag was automatically added for rootless containers, and that wasn't always required. The current PR instead just exposes this feature to the user.

LGTM

@rhatdan
Copy link
Member

rhatdan commented Oct 15, 2018

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit 4386d22 has been approved by rhatdan

rh-atomic-bot pushed a commit that referenced this pull request Oct 15, 2018
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>

Closes: #1071
Approved by: rhatdan
rh-atomic-bot pushed a commit that referenced this pull request Oct 15, 2018
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>

Closes: #1071
Approved by: rhatdan
@rh-atomic-bot
Copy link
Collaborator

⌛ Testing commit 4386d22 with merge a84b205...

@rh-atomic-bot
Copy link
Collaborator

☀️ Test successful - status-papr
Approved by: rhatdan
Pushing a84b205 to master...

@afbjorklund
Copy link
Contributor Author

Thank you, seems to be working with it fine in minikube - see linked issue for a complete example.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants