cool-easter-32542
06/28/2023, 9:51 AMdiff --git a/BUILD b/BUILD
index fca77e4..0acfb4b 100644
--- a/BUILD
+++ b/BUILD
@@ -5,3 +5,10 @@
# `python_requirement_library` target. Refer to
# <https://www.pantsbuild.org/docs/python-third-party-dependencies>.
python_requirements(name="reqs")
+
+docker_environment(
+ name="ubuntu-base",
+ platform="linux_x86_64",
+ image="ubuntu",
+ python_bootstrap_search_path=["<PATH>"],
+)
diff --git a/helloworld/BUILD b/helloworld/BUILD
index 5e55812..c882cf7 100644
--- a/helloworld/BUILD
+++ b/helloworld/BUILD
@@ -13,4 +13,5 @@ python_sources(
pex_binary(
name="pex_binary",
entry_point="main.py",
+ environment="linux_docker"
)
diff --git a/pants.toml b/pants.toml
index d0981a6..f15b626 100644
--- a/pants.toml
+++ b/pants.toml
@@ -44,3 +44,6 @@ resolves = { python-default = "python-default.lock"}
# problematic system Pythons. See
# <https://www.pantsbuild.org/docs/python-interpreter-compatibility#changing-the-interpreter-search-path>.
search_path = ["<PATH>", "<PYENV>"]
+
+[environments-preview.names]
+linux_docker = "//:ubuntu-base"
run
$ pants package ::
10:18:36.00 [INFO] Completed: Pulling Docker image `ubuntu` because the image is missing locally.
10:18:36.00 [ERROR] 1 Exception encountered:
Engine traceback:
in `package` goal
IntrinsicError: Failed to pull image `ubuntu`: Failed to pull Docker image
`ubuntu`: DockerStreamError { error: "toomanyrequests: You have reached
your pull rate limit. You may increase the limit by authenticating and
upgrading: <https://www.docker.com/increase-rate-limit>" }
after logging in to Docker hub in the terminal, the error persists anyway. I wonder if there are multiple (redundant) processes that are spawned and attempt to pull the image at the same time resulting in the rate limit violation.
Pants version
2.16.0 and latest 2.18.0.dev1
OS
Linux
Additional info
Doing docker pull ubuntu first before running a Pants goal works fine pulling the image.
pantsbuild/pants