Skip to content

Commit

Permalink
enable temp directory customization
Browse files Browse the repository at this point in the history
For user mode containers (used by lima), it has difficulty creating mounts
that do not reside under a vm mount

This allows a temp directory to be used that is within the current docker mounts
  • Loading branch information
kbrock committed Oct 16, 2024
1 parent 93fc700 commit cf6ad26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/floe/container_runner/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def initialize(options = {})
@network = options.fetch("network", "bridge")
@pull_policy = options["pull-policy"]
@platform = options["platform"]
# docker in user mode needs the temp dir to be mounted in the volume
# if this is not passed, ENV["TMPDIR"] or other values will be used
@tmpdir = options["TMPDIR"]
end

def run_async!(resource, env, secrets, context)
Expand Down Expand Up @@ -203,7 +206,7 @@ def delete_secret(secrets_file)
end

def create_secret(secrets)
secrets_file = Tempfile.new
secrets_file = Tempfile.new("secret.", @tmpdir)
secrets_file.write(secrets.to_json)
secrets_file.close
secrets_file.path
Expand Down

0 comments on commit cf6ad26

Please sign in to comment.