Comments (8)
For trying out Bazel, I'm having a hard time finding the kind of example that is docker specific - Something prescriptive for going from current state (Dockerfile, script that runs docker build and docker push) to desired state (no more docker engine, use Bazel instead). Unfortunately, the docs and examples I've been able to find so far are either language specific (build Golang binary, build docker image from that) or incomplete (they show a few bits and pieces, but nothing end to end). Maybe I'm just looking in the wrong place, but trying to evaluate whether we can migrate from bash+docker to Bazel is frustrating. I concerned that I'll have to go all-in on understanding Bazel in order to understand how to do what I view as what should be a fairly straightforward use case.
Are there any nontrivial, "here's a dockerfile, here's the equivalent BUILD file" examples? The closest I could find was this old post that doesn't work for me: https://blog.bazel.build/2015/07/28/docker_build.html
from rules_docker.
Here we are, a year later, and I'm facing exactly the same issue that @ryanthecubfan is. I really like to get started with using Bazel in my polyglot monorepo but man, Bazel is hard if you've never used a build system before.
from rules_docker.
We're working on integrating it into a wider set of sample, you can try out: https://github.com/GoogleCloudPlatform/distroless/tree/master/examples
from rules_docker.
@dlorenc Not sure you saw this.
from rules_docker.
Just to post back here. My goal is to move towards a model where users learn to write their foo_binary
rule (e.g. go_binary
, cc_binary
, java_binary
, ...), they can then swap in one of the new foo_image
rules, which have identical signature to their foo_binary
counterparts.
I expect this would cover a significant percentage of folks who just want their application to run in a container in an appropriate target environment.
I still think we want/need samples, including for both foo_image
and cases where folks want to graduate beyond foo_image
to do more sophisticated things those don't easily allow.
from rules_docker.
I have an example that use the foo_image
rules (which wraps docker_build
+ distroless) in a number of languages to implement a GRPC service that deploys to Kubernetes here.
from rules_docker.
Ran into this problem as well when using cc_image
. Following the current README instructions, I couldn't figure out where the C++ binary was being placed. After getting some help on the Slack channel and reviewing https://github.com/bazelbuild/rules_docker/blob/master/lang/image.bzl#L267,
I found my binary under /app/main/narr
where my cc_binary
would normally be written under bazel-bin/main/narr
. This isn't the best tutorial but hopefully sharing my experience can help move things along
from rules_docker.
Closing due to age/inactivity.
from rules_docker.
Related Issues (20)
- When sandbox network is disabled rules_docker rules cannot communicate with docker daemon HOT 1
- Multi-Architecture Support for container_run_and_commit HOT 1
- Shelless invocation for container_run_and_commit HOT 1
- Support multiple python versions in py3_image's py_binary HOT 1
- Support image labels/annotations HOT 1
- Default to Bazel target architecture HOT 2
- Bad timezone for Marocco with @go_image_base//image
- Use binary output from go_binary for go_image
- `container_run_and_extract` does not work with Podman HOT 1
- How to properly use dockerfile_image? HOT 4
- How to get the coredump file in container?
- Sporadic failures of `wrong number of hex digits for sha256`
- The `workdir` for `cc_image` is not the runfiles directory by default.
- go_image always builds for linux/amd64 irrespective of host platform
- rules_nodejs and rules_docker conflict
- container_pull failed for images layers with MediaType "application/vnd.docker.image.rootfs.diff.tar"
- portable_mtime for py3_image
- Support Native Bazel Tags for Build Querying
- py3_image: No Matching Toolchains Found
- rules_docker fails to build with HEAD bazel
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_docker.