powerful-city-61287
11/01/2024, 4:08 PMdocker save
like so:
shell_command(
name="save_docker_image",
command="docker save localhost:5001/mono:latest -o mono_img.tar",
execution_dependencies=["apps/mono:mono"], # the docker_image target
tools=["docker"],
output_files=["mono_img.tar"],
workdir="/",
)
resource(name="mono_img", dependencies=[":save_docker_image"], source="mono_img.tar")
archive(
name="archive",
format="tar.xz",
output_path="normal_skh.tar.xz",
files=[":mono_img"],
)
Not quite working, though. (The above generates an empty .tar.xz
). I haven't used shell_command
before, so my confusion likely lies there.broad-processor-92400
11/01/2024, 7:08 PMresource
is designed for reading files that are directly on disk, (that is, mono_img.tar
needs to be in your repo directly), while the shell command is creating ephemeral code gen. Can you try the archive depending on the shell command directly?