From d506a7250a5141c3574d53bf19821e08b8a550ec Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Tue, 2 Jul 2024 13:01:07 -0300 Subject: [PATCH] Mount secrets into containers --- src/funko.cr | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/funko.cr b/src/funko.cr index 9a152bf..a6b1a56 100644 --- a/src/funko.cr +++ b/src/funko.cr @@ -161,12 +161,21 @@ class Funko # Create a container for this funko def create_container(autostart : Bool = true) : String + secrets_mount = "#{Dir.current}/secrets/#{name}" + Dir.mkdir_p(secrets_mount) conf = Docr::Types::CreateContainerConfig.new( image: "#{name}:latest", hostname: name, # Port in the container side host_config: Docr::Types::HostConfig.new( network_mode: "faaso-net", + mounts: [ + Docr::Types::Mount.new( + source: secrets_mount, + target: "/secrets", + type: "bind" + ) + ] ) )