Use the td_cleanup_sandbox_env() function to remove the container and the Docker image set up using the function td_setup_sandbox_env().
- The Docker image loaded by the td_setup_sandbox_env() function is not removed if there is another container created from the same image. If there is no other container, then image is cleaned up.
- If a user creates a container 'container_1' without using td_setup_sandbox_env() function and sets the option sandbox.container with this value, then the function does not remove the container 'container_1' and the image associated with it.
The user is responsible for removing the image and associated container manually.
- If a user sets the option sandbox.container manually and runs the function td_setup_sandbox_env() later, then this function resets the option sandbox.container to NULL and performs the cleanup of the container and image created and loaded by the td_setup_sandbox_env() function.
- If a user runs td_setup_sandbox_env() function and then sets the option sandbox.container manually to a different container, then this function cleans up the container and image created and loaded by the td_setup_sandbox_env() function, but the value of option sandbox.container remains the same.
- Removing the context or ending the session also performs cleanup similar to this function.
- To see if there are any issues while dropping the container and image, the user can set the option td.debug.enable to TRUE.
Example
> td_cleanup_sandbox_env()