Looking for inspiration. I'm trying to generate an...
# general
p
Looking for inspiration. I'm trying to generate an archive containing the results of
docker save
like so:
Copy code
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.
b
I think
resource
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?