MCPcopy Index your code
hub / github.com/astral-sh/python-build-standalone / write_dockerfiles

Function write_dockerfiles

pythonbuild/docker.py:19–29  ·  view source on GitHub ↗
(source_dir: pathlib.Path, dest_dir: pathlib.Path)

Source from the content-addressed store, hash-verified

17
18
19def write_dockerfiles(source_dir: pathlib.Path, dest_dir: pathlib.Path):
20 env = jinja2.Environment(loader=jinja2.FileSystemLoader(str(source_dir)))
21
22 for f in os.listdir(source_dir):
23 if not f.endswith(".Dockerfile"):
24 continue
25
26 tmpl = env.get_template(f)
27 data = tmpl.render()
28
29 write_if_different(dest_dir / f, data.encode("utf-8"))
30
31
32def build_docker_image(

Callers 1

mainFunction · 0.90

Calls 2

write_if_differentFunction · 0.85
renderMethod · 0.45

Tested by

no test coverage detected