Hi all, I’m using a `docker_environment` in order ...
# general
d
Hi all, I’m using a
docker_environment
in order to build a linux compatible image from my MacOS dev machine.
Copy code
[environments-preview.names]
linux = "//:linux"
macos = "//:macos"
docker = "//:docker"
Copy code
docker_environment(
    name="docker",
    platform="linux_arm64",
    image="base",
    python_bootstrap_search_path=["<PATH>"],
)

docker_image(
    name="base",
    instructions=[
        "FROM --platform=linux/arm64 python:3.11-slim",
        "RUN apt update && apt install -y gcc libpq-dev",
    ],
)
I’ve got a service / pex_binary that uses this docker_environment
Copy code
pex_binary(
    name="gunicorn",
    entry_point="gunicorn",
    args=["services.a.app.app:create_app()"],
    dependencies=["./app", ":files"],
    environment=parametrize("linux", "macos"),
)
Is there any way to add my base image as a dependency of
docker_environment
? I.e.
Copy code
docker_environment(
    image=":base",
    ...
)

docker_image(
    name="base",
    ....
)
Right now I have to first do
pants package:base
before running
pants package services/a:gunicorn
1
1
c
Currently no, it’s tracked by this issue: https://github.com/pantsbuild/pants/issues/17714
1
d
Thanks Andreas, I’ll track that issue.
👍 1