{"id":28749682,"url":"https://github.com/psigen/rules_docker-issue-2124","last_synced_at":"2026-01-30T20:32:17.519Z","repository":{"id":151961329,"uuid":"559920400","full_name":"psigen/rules_docker-issue-2124","owner":"psigen","description":"Reproduction of https://github.com/bazelbuild/rules_docker/issues/2124","archived":false,"fork":false,"pushed_at":"2022-11-12T23:12:53.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-16T20:50:53.360Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/psigen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-10-31T11:30:53.000Z","updated_at":"2022-10-31T11:32:27.000Z","dependencies_parsed_at":"2023-06-02T04:30:32.615Z","dependency_job_id":null,"html_url":"https://github.com/psigen/rules_docker-issue-2124","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/psigen/rules_docker-issue-2124","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psigen%2Frules_docker-issue-2124","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psigen%2Frules_docker-issue-2124/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psigen%2Frules_docker-issue-2124/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psigen%2Frules_docker-issue-2124/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psigen","download_url":"https://codeload.github.com/psigen/rules_docker-issue-2124/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psigen%2Frules_docker-issue-2124/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28918451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T20:25:28.696Z","status":"ssl_error","status_checked_at":"2026-01-30T20:25:13.426Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-16T20:44:06.825Z","updated_at":"2026-01-30T20:32:17.512Z","avatar_url":"https://github.com/psigen.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rules_docker-issue-2124\n\nThis is a replication of the issue described in:\nhttps://github.com/bazelbuild/rules_docker/issues/2124\n\nTo replicate the issue, run the following command:\n\n```bash\n$ bazel run //:image -- -e=baz=C -- --beep\n```\n\nThis produces the following incorrect output:\n\n```bash\n$ bazel run //:image -- -e=baz=C -- --beep\nDEBUG: /home/berkshiregrey.com/pras/.cache/bazel/_bazel_pras/dcecc182d8325095d3b3ff25e867cee5/external/io_bazel_rules_docker/container/image.bzl:353:10: impl orig entrypoint: [\"/usr/bin/java\", \"-cp\", \"/app/__main__/liblib.jar:/app/__main__/image.binary.jar:/app/__main__/image.binary\", \"demo.Main\", \"-e=foo=A\", \"-e=bar=B\"]\nDEBUG: /home/berkshiregrey.com/pras/.cache/bazel/_bazel_pras/dcecc182d8325095d3b3ff25e867cee5/external/io_bazel_rules_docker/container/image.bzl:354:10: impl orig cmd: None\nDEBUG: /home/berkshiregrey.com/pras/.cache/bazel/_bazel_pras/dcecc182d8325095d3b3ff25e867cee5/external/io_bazel_rules_docker/container/image.bzl:377:10: impl used entrypoint: [\"/usr/bin/java\", \"-cp\", \"/app/__main__/liblib.jar:/app/__main__/image.binary.jar:/app/__main__/image.binary\", \"demo.Main\", \"-e=foo=A\", \"-e=bar=B\"]\nDEBUG: /home/berkshiregrey.com/pras/.cache/bazel/_bazel_pras/dcecc182d8325095d3b3ff25e867cee5/external/io_bazel_rules_docker/container/image.bzl:378:10: impl used cmd: []\nDEBUG: /home/berkshiregrey.com/pras/.cache/bazel/_bazel_pras/dcecc182d8325095d3b3ff25e867cee5/external/io_bazel_rules_docker/container/image.bzl:155:10: _add_create_image_config_args args: -outputConfig bazel-out/k8-fastbuild-ST-4a519fd6d3e4/bin/image.0.config -outputManifest bazel-out/k8-fastbuild-ST-4a519fd6d3e4/bin/image.0.manifest -entrypoint /usr/bin/java -entrypoint -cp -entrypoint /app/__main__/liblib.jar:/app/__main__/image.binary.jar:/app/__main__/image.binary -entrypoint demo.Main -entrypoint -e=foo=A -entrypoint -e=bar=B -env JAVA_RUNFILES=/app -layerDigestFile @bazel-out/k8-fastbuild-ST-4a519fd6d3e4/bin/image-layer.tar.sha256 -baseConfig external/java/image/config.json -architecture amd64 -operatingSystem linux\nDEBUG: /home/berkshiregrey.com/pras/.cache/bazel/_bazel_pras/dcecc182d8325095d3b3ff25e867cee5/external/io_bazel_rules_docker/container/image.bzl:247:10: _assemble_image_digest args:\nDEBUG: /home/berkshiregrey.com/pras/.cache/bazel/_bazel_pras/dcecc182d8325095d3b3ff25e867cee5/external/io_bazel_rules_docker/container/image.bzl:545:10: impl executable path bazel-out/k8-fastbuild-ST-4a519fd6d3e4/bin/image.executable\nINFO: Analyzed target //:image (113 packages loaded, 7870 targets configured).\nINFO: Found 1 target...\nTarget //:image up-to-date:\n  bazel-out/k8-fastbuild-ST-4a519fd6d3e4/bin/image-layer.tar\nINFO: Elapsed time: 1.232s, Critical Path: 0.01s\nINFO: 1 process: 1 internal.\nINFO: Build completed successfully, 1 total action\nINFO: Build completed successfully, 1 total action\nincremental_load.sh ALL: -e=foo=A -e=bar=B -e=baz=C -- --beep\nLoaded image ID: sha256:c57665c0d380db630c97c9a2b20f86370653ad66ec9e0ddb60f481b3d9820e91\nTagging c57665c0d380db630c97c9a2b20f86370653ad66ec9e0ddb60f481b3d9820e91 as bazel:image\nincremental_load.sh ARGS: /usr/bin/docker run -i --rm --network=host -e=foo=A -e=bar=B -e=baz=C bazel:image --beep\nhello there!\n[-e=foo=A, -e=bar=B, --beep]\n```\n\n## Explanation\n\nThis reproduction uses four distinct flags that should be visible in different places.\n\n- `-e=foo=A` - this should be included in the image entrypoint and not passed by `bazel run`\n- `-e=bar=B` - this should be included in the image entrypoint and not passed by `bazel run`\n- `-e=baz=C` - this should be passed by `bazel run` to `docker run`\n- `--beep` - this should be passed by `bazel run` to the application\n\nWe would therefore expect the following output from our debugging:\n\n```\nincremental_load.sh ARGS: /usr/bin/docker run -i --rm --network=host -e=baz=C bazel:image --beep\nhello there!\n[-e=foo=A, -e=bar=B, --beep]\n```\n\nNote the following problems with the actual output:\n\nWe can see that the original entrypoint includes all the flags necessary to run the command.\nI.e. the entrypoint and command already include the \"-e=foo=A\" and \"-e=bar=B\" flags.\n\n```\ncontainer/image.bzl:377:10: impl used entrypoint: [\"/usr/bin/java\", \"-cp\", \"/app/__main__/liblib.jar:/app/__main__/image.binary.jar:/app/__main__/image.binary\", \"demo.Main\", \"-e=foo=A\", \"-e=bar=B\"]\nDEBUG: /home/berkshiregrey.com/pras/.cache/bazel/_bazel_pras/dcecc182d8325095d3b3ff25e867cee5/external/io_bazel_rules_docker/container/image.bzl:378:10: impl used cmd: [\"/usr/bin/java\", \"-cp\", \"/app/__main__/liblib.jar:/app/__main__/image.binary.jar:/app/__main__/image.binary\", \"demo.Main\", \"-e=foo=A\", \"-e=bar=B\"]\n```\n\nHowever, these same args are passed again to the incremental load script, even though they are already in the entrypoint command:\n\n```\nincremental_load.sh ARGS: /usr/bin/docker run -i --rm --network=host -e=foo=A -e=bar=B -e=baz=C bazel:image --beep\n```\n\nFinally, the _original_ args are still correctly passed to the executable _and_ appended correctly to the new argument.\n\n```\n[-e=foo=A, -e=bar=B, --beep]\n```\n\nThis means that the original args added to the entrypoint worked, and the args passed to the docker-run command were unnecessary.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsigen%2Frules_docker-issue-2124","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsigen%2Frules_docker-issue-2124","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsigen%2Frules_docker-issue-2124/lists"}