| 164 | |
| 165 | |
| 166 | async def test_container_with(alpine_image: str): |
| 167 | def env(ctr: dagger.Container): |
| 168 | return ctr.with_env_variable("FOO", "bar") |
| 169 | |
| 170 | def secret(token: str): |
| 171 | def _secret(ctr: dagger.Container): |
| 172 | return ctr.with_secret_variable("TOKEN", dag.set_secret("TOKEN", token)) |
| 173 | |
| 174 | return _secret |
| 175 | |
| 176 | await ( |
| 177 | dag.container() |
| 178 | .from_(alpine_image) |
| 179 | .with_(env) |
| 180 | .with_(secret("baz")) |
| 181 | .with_exec(["sh", "-c", "test $FOO = bar && test $TOKEN = baz"]) |
| 182 | .sync() |
| 183 | ) |
| 184 | |
| 185 | |
| 186 | async def test_container_sync(alpine_image: str): |