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

How do you create a builder in a CI? #209

Closed
poy opened this issue Jun 8, 2019 · 10 comments
Closed

How do you create a builder in a CI? #209

poy opened this issue Jun 8, 2019 · 10 comments

Comments

@poy
Copy link

poy commented Jun 8, 2019

According to the README, pack is intended for

Buildpack authors to develop and package buildpacks for distribution.

However, pack also requires the docker CLI. This implies it won't easily fit into a CI. So what is the correct way for a buildpacks developer to create (via automation) buildpack builders?

@sclevine
Copy link
Member

sclevine commented Jun 8, 2019

The pack CLI only requires a Docker daemon for two things:

  1. To run containers during pack build. (And this is only because macOS and Windows systems don’t natively support Linux containers. To build app images in CI, you can use the lifecycle directly in unprivileged containers provided by your platform.)

  2. To store images when you don’t pass --publish to any command that generates an image.

So pack create-builder --publish does not require a Docker daemon. We should definitely document this clearly.

@poy
Copy link
Author

poy commented Jun 8, 2019

Awesome thanks!

@poy poy closed this as completed Jun 8, 2019
@poy
Copy link
Author

poy commented Jun 10, 2019

So it seems like pack still requires docker even when publishing. I created a docker container with pack that tried to publish to gcr.io, however I got the following error:

ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

@poy poy reopened this Jun 10, 2019
@sclevine
Copy link
Member

That’s very surprising. While pack build --publish requires a Docker daemon (because running buildpack code always requires a container), pack create-builder --publish should not.

Could you provide the command you executed and all of the output?

@poy
Copy link
Author

poy commented Jun 10, 2019

I created a BuildTemplate (knative) that uses an image with pack installed. It then does the following command:

pack create-builder --publish --builder-config=/workspace/builder.toml ${IMAGE}

The build fails. The logs are:

ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

@poy
Copy link
Author

poy commented Jun 10, 2019

OK, I've made some progress on this. It works as you say if I build pack from master. However version .0.2.1 does not.

@ekcasey
Copy link
Member

ekcasey commented Jun 11, 2019

@poy this looks like a bug to me, even on master, introduced with the run-image validation in v0.2.0.

I think this PR should provide the fix #213

@poy
Copy link
Author

poy commented Jun 18, 2019

@ekcasey Sounds good. One thing to note, it did work with master. Can we get a new release with this fix?

@ekcasey
Copy link
Member

ekcasey commented Jun 19, 2019

@poy we hope to ship pack v0.3.0 in approximately one week

@ekcasey
Copy link
Member

ekcasey commented Jun 19, 2019

I am going to close this given that the bug is fixed on master, feel free to reopen @poy if you have any additional questions

@ekcasey ekcasey closed this as completed Jun 19, 2019
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

3 participants