diff --git a/src/batou_ext/oci.py b/src/batou_ext/oci.py index c5010f6..6a6b41c 100644 --- a/src/batou_ext/oci.py +++ b/src/batou_ext/oci.py @@ -31,6 +31,7 @@ class Container(Component): # specific options entrypoint: Optional[str] = None + docker_cmd: str = "" envfile: Optional[str] = None mounts: dict = {} ports: dict = {} @@ -66,6 +67,9 @@ def configure(self): # spec version overrides the argument provided or default version if spec_tag: self.version = spec_tag + else: + # append version to image string when passed seperately + self.image = f"{self.image}:{self.version}" else: raise RuntimeError( f"could not match the docker spec against the provided container image string: '{self.image}'" diff --git a/src/batou_ext/resources/oci-template.nix b/src/batou_ext/resources/oci-template.nix index 2c3465f..1217d6e 100644 --- a/src/batou_ext/resources/oci-template.nix +++ b/src/batou_ext/resources/oci-template.nix @@ -17,10 +17,14 @@ virtualisation.oci-containers = { backend = "docker"; containers."{{component.container_name}}" = { - # {% if component.entrypoint != None %} + # {% if component.entrypoint %} entrypoint = "{{component.entrypoint}}"; # {% endif %} + # {% if component.docker_cmd %} + cmd = [ {% for cmd in component.docker_cmd.split(" ") %} "{{cmd}}" {% endfor %} ]; + # {% endif %} + # {% if component.registry_address %} login = { registry = "{{component.registry_address}}"; diff --git a/src/batou_ext/s3.py b/src/batou_ext/s3.py index 7bead21..6bf5925 100644 --- a/src/batou_ext/s3.py +++ b/src/batou_ext/s3.py @@ -29,7 +29,13 @@ class S3(batou.component.Component): - """Configuration for an S3 connection and its credentials.""" + """Configuration for an S3 connection and its credentials. + + Keyword arguments: + access_key_id -- The S3 access key ID + secret_access_key -- The S3 secret access key + endpoint_url -- The S3 enpoint's URL + """ _required_params_ = { "access_key_id": "value",