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

chore: cleanup local build rule and docs #747

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push", "oci_tarball")
load("@rules_pkg//:pkg.bzl", "pkg_tar")

gazelle(
Expand Down Expand Up @@ -132,6 +132,12 @@ oci_image(
visibility = ["//visibility:public"],
)

oci_tarball(
name = "bazel-remote-image-tarball",
image = ":bazel-remote-image",
repo_tags = ["buchgr/bazel-remote-cache:tmp-amd64"],
)

pkg_tar(
name = "bazel-remote-linux-arm64_tar",
srcs = [":bazel-remote-linux-arm64"],
Expand Down Expand Up @@ -159,6 +165,12 @@ oci_image(
visibility = ["//visibility:private"],
)

oci_tarball(
name = "bazel-remote-image-arm64-tarball",
image = ":bazel-remote-image-arm64",
repo_tags = ["buchgr/bazel-remote-cache:tmp-arm64"],
)

# The following container_push targets push to "tmp-amd64" and "tmp-arm64"
# tags, so they can be combined into a multiarch tag on dockerhub. This
# isn't currently possible with rules_docker, so instead we rely on some
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,8 @@ See [examples/docker-compose.yml](examples/docker-compose.yml) for an example co
The command below will build a docker image from source and install it into your local docker registry.

```bash
$ bazel run :bazel-remote-image -- --max_size 5 --dir /your/path/to/data
$ bazel build :bazel-remote-image-tarball && docker load -i bazel-bin/bazel-remote-image-tarball/tarball.tar
$ docker run buchgr/bazel-remote-cache:tmp-amd64 --max_size 5 --dir /your/path/to/data
```

### ARM Support
Expand All @@ -667,7 +668,8 @@ Bazel remote cache server can be run on an ARM architecture (i.e.: on a Raspberr
To build for ARM, use:

```bash
$ bazel run :bazel-remote-image-arm64 -- --max_size 5 --dir /your/path/to/data
$ bazel build :bazel-remote-image-arm64-tarball && docker load -i bazel-bin/bazel-remote-image-arm64-tarball/tarball.tar
$ docker run buchgr/bazel-remote-cache:tmp-arm64 --max_size 5 --dir /your/path/to/data
```

## Build a standalone Linux binary
Expand Down
Loading