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

Clarification - using generated ruby_binary in container image #89

Open
robertgates55 opened this issue Mar 7, 2021 · 2 comments
Open
Labels
feature New feature or request

Comments

@robertgates55
Copy link

Hey - I'm a bazel noob, so apologies for the question, but I'm trying to produce a container image with my rails project using these rules and I'm stuck.

I have a ruby_binary package in my BUILD (largely cribbed from the examples/simple_rails_api dir) which builds successfully. But I'm then coming up dry getting that into a runnable container. I've looked at py_binary for inspiration, but there seems to be a py_image (https://github.com/bazelbuild/rules_docker#py_image) rules_docker rule that does the work for that. How can I go about doing it with container_layer and container_image rules? Is the idea that the ruby_binary produces a binary that requires no other deps?

@robertgates55 robertgates55 changed the title Clarification - using generated files in container images Clarification - using generated ruby_binary in container image Mar 7, 2021
@kigster
Copy link
Contributor

kigster commented Jul 8, 2021

Ruby binary most definitely will need dependencies.

It's possible we would have to implement a similar to Python rule ruby_image to build docker image with all the dependencies.

You may be able to do the packaging of all dependencies using a genrule that executes a shell script to create a dockerfile in the root of runfiles for your target and build the container there.

To be honest i am not super familiar with the container rules.

@kigster
Copy link
Contributor

kigster commented Jul 8, 2021

I'd suggest you examine the runfiles folder for your binary target to see the layout. It should contain symlinks to all the dependencies.

@kigster kigster added the feature New feature or request label Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants