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

Support buildah / imagebuilder #177

Closed
pmorie opened this issue Oct 14, 2020 · 14 comments
Closed

Support buildah / imagebuilder #177

pmorie opened this issue Oct 14, 2020 · 14 comments

Comments

@pmorie
Copy link
Member

pmorie commented Oct 14, 2020

I should be able to build a function without requiring the docker daemon, for example with buildah or podman.

@matejvasek
Copy link
Contributor

@pmorie Unfortunately BuildPack doesn't work without docker. We tried podman, but without success.

@lance
Copy link
Member

lance commented Oct 14, 2020

@matejvasek I've been reading up on this and I think there is a way... see: buildpacks/pack#564. I will try to summarize here after I have digested.

@matejvasek
Copy link
Contributor

matejvasek commented Oct 14, 2020

@lance If you think about DOCKER_HOST I tried that (and @dsimansk too) and it didn't work.

@lance
Copy link
Member

lance commented Oct 14, 2020

Some notable comments from that issue.

It is possible add support for podman by running it as a service with podman system service and adding detection of podman socket containers/podman#4499 (comment) The socket is meant to be Docker-compatible. [https://github.com/buildpacks/pack/issues/564#issuecomment-609898677]

The pack CLI is intended to be a tool for running Cloud Native Buildpack builds on a local workstation that doesn't natively support containers (often Windows or macOS). While it seems reasonable to support other local container runtimes besides Docker, CI platforms that support running container images are probably better off running the lifecycle directly, without needed a nested container runtime. (This doesn't require any privileges or capabilities.) [https://github.com/buildpacks/pack/issues/564#issuecomment-609909824]

kpack is pivotal's buildpack lifecycle CLI and it does not require Docker because it uses the lifecycle directly.

the lifecycle is comparable to kaniko or other unprivileged image building tools. The pack CLI is glue code that makes it easy to use lifecycle with the Docker daemon. [link]

I think it's time we become a bit more familiar with the buildpack lifecycle spec.

@matejvasek
Copy link
Contributor

kpack is for building in k8s cluster, isn't it?

@matejvasek
Copy link
Contributor

podman system service -- this call to create the socket worked on older version, with newer I got:

podman system service                    
Error: unrecognized command `podman system service`
Try 'podman system --help' for more information.

@matejvasek
Copy link
Contributor

@dsimansk do you recall what you have tried?

@dsimansk
Copy link
Contributor

I've tried buildpacks on the following podman version. For me system service cmd works fine. However, I still got an error during image build in the neighbourhood of "NotAllowedMethod being used", I don't have the exact text handy right now.

podman version

Version:      2.1.1
API Version:  2.0.0
Go Version:   go1.14.9
Built:        Wed Sep 30 21:31:11 2020
OS/Arch:      linux/amd64

@matejvasek
Copy link
Contributor

kpack is pivotal's buildpack lifecycle CLI and it does not require Docker because it uses the lifecycle directly.

the lifecycle is comparable to kaniko or other unprivileged image building tools. The pack CLI is glue code that makes it easy to use lifecycle with the Docker daemon. [link]

I think it's time we become a bit more familiar with the buildpack lifecycle spec.

OK. It should be possible, but it's not going to be as easy as alias docker=podman.

@lance
Copy link
Member

lance commented Oct 15, 2020

OK. It should be possible, but it's not going to be as easy as alias docker=podman.

Agree with that for sure.

@matejvasek
Copy link
Contributor

I did some digging into why podman doesn't work, since it should implement docker APIv2.

  1. The APIv2 containers/(name or id)/archive endpoint is not yet implemented.
    That's why @dsimansk saw NotAllowedMethod being used.
    I am trying to address that Implement containers/{id or name}/archive api containers/podman#8126.

  2. Even when the endpoint is implemented there were issue with another APIv2 endpoint,
    it wasn't returning some information. I fixed that fix: /image/{name or id}/json returns RootFS layers containers/podman#8109.

  3. There was also some minor issue with some defaults value so it was't working with cgroups V1
    fix: neutral value for MemorySwappiness containers/podman#8069.

  4. The pack CLI is not pushing entirely valid image tar. I believe this should be fixed in pack not in podman.
    Ephemeral builder tars are missing base image layers buildpacks/pack#925.

@lance
Copy link
Member

lance commented Oct 28, 2020

@matejvasek great work!

@matejvasek
Copy link
Contributor

@pmorie I made usage of podman (not buildah) possible using DOCKER_HOST envvar. Can I close this issues?

@lance
Copy link
Member

lance commented Aug 11, 2021

I'm going to close this as resolved. If there are additional issues that come up with podman, we can open new issues for them.

@lance lance closed this as completed Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants