<#11 feat: Support secret mounts in local image bu...
# flyte-github
c
#11 feat: Support secret mounts in local image builds Pull request opened by pingsutw In the below example, docker_builder will 1. Read the secret file from
/tmp/secret1
and mount it to the`/run/secrets/secret1` for apt-install 2. Read the secret from env var
AWS_ID
or
/etc/secrets/aws_id
(if env var not found) and mount it as env
AWS_ACCESS_KEY_ID
import flyte image = ( flyte.Image.from_debian_base(install_flyte=False) .with_apt_packages("vim", secret_mount=["/tmp/secret1"]) .with_pip_packages( "mypy", secret_mount=[flyte.Secret(group="aws", key="id", as_env_var="AWS_ACCESS_KEY_ID"]) ) .with_local_v2() ) env = flyte.TaskEnvironment(name="image_secret", image=image) @env.task async def t1(data: str = "hello") -> str: return f"Hello {data}" if name == "__main__": flyte.init_from_config("../../config.yaml") run = flyte.run(t1, data="world") print(run.name) print(run.url) flyteorg/flyte-sdk