This message was deleted.
# python
s
This message was deleted.
r
Hey! You should just be able to pass in a dict to
args
Have you tried this?
Copy code
flask_image = docker.Image("flask-dockerimage",
    image_name=app_ecr_repo_repository_url,
    build=docker.DockerBuild(
        context="./frontend",
        args={
            "db_host_address": db_host_address,
            "db_host_port": db_host_port,
            "db_name": db_name,
            "db_user": db_user,
        }
    ),
    skip_push=False,
    registry=app_registry
)
s
Hi @red-match-15116 - thanks for your help! It turned out I had to do the work of creating the docker.Image within the
apply
statement in order to get things to work. It wasn’t accepting the Outputs within the dict directly.
r
It’s not recommended to create resources within an
apply
- because of the unexpected behavior related to
preview
and the resource graph not being calculated correctly. There’s generally a way to refactor the code so that creating the resource within an apply is not necessary.