Skip to content

Image build failed #37

@superbrothers

Description

@superbrothers

When I tried to create a pull request to update Go dependencies, the image build failed as shown below.

The root cause is that the current Bazel environment is outdated: rules_docker is in maintenance mode, and rules_k8s has been archived.

I suggest taking this opportunity to move away from Bazel. Transitioning to a standard Docker/Go build would be simpler and reduce maintenance overhead. If you agree with this direction, I am happy to handle the migration.

$ make build
building cmds and images
Starting local Bazel server and connecting to it...
INFO: Repository go_image_static instantiated at:
  /home/ksuda/src/github.com/cloudflare/sciuro/WORKSPACE:63:16: in <toplevel>
  /home/ksuda/.cache/bazel/_bazel_ksuda/856046fd2ccd69ea054ea4b4d55bc52a/external/io_bazel_rules_docker/go/image.bzl:64:23: in repositories
Repository rule container_pull defined at:
  /home/ksuda/.cache/bazel/_bazel_ksuda/856046fd2ccd69ea054ea4b4d55bc52a/external/io_bazel_rules_docker/container/pull.bzl:294:33: in <toplevel>
ERROR: An error occurred during the fetch of repository 'go_image_static':
   Traceback (most recent call last):
        File "/home/ksuda/.cache/bazel/_bazel_ksuda/856046fd2ccd69ea054ea4b4d55bc52a/external/io_bazel_rules_docker/container/pull.bzl", line 240, column 13, in _impl
                fail("Pull command failed: %s (%s)" % (result.stderr, " ".join([str(a) for a in args])))
Error in fail: Pull command failed: 2026/02/07 18:15:54 Running the Image Puller to pull images from a Docker Registry...
2026/02/07 18:15:55 Image pull was unsuccessful: reading image "gcr.io/distroless/static@sha256:fac888659ca3eb59f7d5dcb0d62540cc5c53615e2671062b36c815d000da8ef4": GET https://gcr.io/v2/token?scope=repository%3Adistroless%2Fstatic%3Apull&service=gcr.io: UNAUTHORIZED: authentication failed
 (/home/ksuda/.cache/bazel/_bazel_ksuda/856046fd2ccd69ea054ea4b4d55bc52a/external/go_puller_linux_amd64/file/downloaded -directory /home/ksuda/.cache/bazel/_bazel_ksuda/856046fd2ccd69ea054ea4b4d55bc52a/external/go_image_static/image -os linux -os-version  -os-features  -architecture amd64 -variant  -features  -name gcr.io/distroless/static@sha256:fac888659ca3eb59f7d5dcb0d62540cc5c53615e2671062b36c815d000da8ef4)
ERROR: /home/ksuda/src/github.com/cloudflare/sciuro/WORKSPACE:63:16: fetching container_pull rule //external:go_image_static: Traceback (most recent call last):
        File "/home/ksuda/.cache/bazel/_bazel_ksuda/856046fd2ccd69ea054ea4b4d55bc52a/external/io_bazel_rules_docker/container/pull.bzl", line 240, column 13, in _impl
                fail("Pull command failed: %s (%s)" % (result.stderr, " ".join([str(a) for a in args])))
Error in fail: Pull command failed: 2026/02/07 18:15:54 Running the Image Puller to pull images from a Docker Registry...
2026/02/07 18:15:55 Image pull was unsuccessful: reading image "gcr.io/distroless/static@sha256:fac888659ca3eb59f7d5dcb0d62540cc5c53615e2671062b36c815d000da8ef4": GET https://gcr.io/v2/token?scope=repository%3Adistroless%2Fstatic%3Apull&service=gcr.io: UNAUTHORIZED: authentication failed
 (/home/ksuda/.cache/bazel/_bazel_ksuda/856046fd2ccd69ea054ea4b4d55bc52a/external/go_puller_linux_amd64/file/downloaded -directory /home/ksuda/.cache/bazel/_bazel_ksuda/856046fd2ccd69ea054ea4b4d55bc52a/external/go_image_static/image -os linux -os-version  -os-features  -architecture amd64 -variant  -features  -name gcr.io/distroless/static@sha256:fac888659ca3eb59f7d5dcb0d62540cc5c53615e2671062b36c815d000da8ef4)
ERROR: /home/ksuda/src/github.com/cloudflare/sciuro/cmd/sciuro/BUILD.bazel:27:9: //cmd/sciuro:image depends on @go_image_static//image:image in repository @go_image_static which failed to fetch. no such package '@go_image_static//image': Pull command failed: 2026/02/07 18:15:54 Running the Image Puller to pull images from a Docker Registry...
2026/02/07 18:15:55 Image pull was unsuccessful: reading image "gcr.io/distroless/static@sha256:fac888659ca3eb59f7d5dcb0d62540cc5c53615e2671062b36c815d000da8ef4": GET https://gcr.io/v2/token?scope=repository%3Adistroless%2Fstatic%3Apull&service=gcr.io: UNAUTHORIZED: authentication failed
 (/home/ksuda/.cache/bazel/_bazel_ksuda/856046fd2ccd69ea054ea4b4d55bc52a/external/go_puller_linux_amd64/file/downloaded -directory /home/ksuda/.cache/bazel/_bazel_ksuda/856046fd2ccd69ea054ea4b4d55bc52a/external/go_image_static/image -os linux -os-version  -os-features  -architecture amd64 -variant  -features  -name gcr.io/distroless/static@sha256:fac888659ca3eb59f7d5dcb0d62540cc5c53615e2671062b36c815d000da8ef4)
ERROR: Analysis of target '//cmd/sciuro:image' failed; build aborted: Analysis failed
INFO: Elapsed time: 5.112s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (54 packages loaded, 432 targets configured)
    Fetching @io_k8s_sigs_controller_runtime; Restarting.
    Fetching @com_github_prometheus_alertmanager; Restarting.
    Fetching @io_k8s_api; Restarting.
    Fetching @com_github_caarlos0_env_v9; Restarting.
    Fetching @bazel_gazelle_go_repository_config; Restarting.
    Fetching @bazel_gazelle_go_repository_cache; Restarting.
    Fetching @go_sdk; Downloading and extracting Go toolchain
make: *** [Makefile:47: build] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions