Packages
TestcontainerEx is an Elixir library for integration testing with containerized services. Start, stop, and monitor Docker, Podman, Minikube, Colima, or Apple Container containers with a unified API. Supports custom containers.
Current section
Files
Jump to
Current section
Files
lib/copy_to.ex
defmodule TestcontainerEx.CopyTo do
@moduledoc false
alias TestcontainerEx.Docker
@doc """
Copy a string of contents into a file at target
"""
def copy_to(conn, id, %{"target" => target, "contents" => contents})
when is_binary(target) and is_binary(contents) do
Docker.Api.put_file(id, conn, Path.dirname(target), Path.basename(target), contents)
end
# add more implementation for copy_to as you need them, eg.
# - copy a dir into a dir
# - copy a file into a file
# - copy an archive into a file
end