Skip to content

Temp files should be created in a temp directory #423

Closed

Description

@axelfontaine

Currently temp files are created in the current directory. This leads to a mess in case the JVM crashes. Instead the files should be created in a subdirectory of the temp directory.

Activity

  1. bsideup commented on Aug 1, 2017

    @bsideup
    Member

    Hi @axelfontaine,

    Unfortunately, Docker doesn't allow mounts outside of user home directory, at least on Mac / Windows, this is why we do that. Any idea how to improve?

  2. axelfontaine commented on Aug 1, 2017

    @axelfontaine
    Author

    The file I had was actually created in my source directory on the host Windows x64 machine and it doesn't lie under my user home. I have a feeling this temp file may not have been created by Docker, but by testcontainers itself. (I deleted before filing this issue and forgot to write down the exact name, but it was something like .testcontainers.tmp.something

  3. axelfontaine commented on Aug 1, 2017

    @axelfontaine
    Author

    The culprit is the first line in org.testcontainers.utility.MountableFile.extractClassPathResourceToTempLocation() :

    File tmpLocation = new File(".testcontainers-tmp-" + Base58.randomString(5));
  4. arcuri82 commented on Aug 8, 2017

    @arcuri82

    Having this same issue, where my folders get polluted by these tmp files. If for any reason the TMP folder of the OS cannot be used, a better default location than "." could be "./target" (at least for Maven builds)

  5. kiview commented on Dec 9, 2017

    @kiview
    Member

    Has been fixed with #450.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions