Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions runlike/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ def parse_entrypoint(self):
if len(entrypoints) > 0 and entrypoints != image_entrypoints:
self.options.append("--entrypoint %s" % entrypoints[0])

def parse_nanocpus(self):
cpus = self.get_container_fact("HostConfig.NanoCpus")
if cpus:
self.options.append(f'--cpus="{cpus/1000000000}"')

def format_cli(self):
image = self.get_container_fact("Config.Image")
self.options = []
Expand Down Expand Up @@ -309,6 +314,7 @@ def format_cli(self):
self.parse_shm_size()
self.parse_memory()
self.parse_memory_reservation()
self.parse_nanocpus()

stdout_attached = self.get_container_fact("Config.AttachStdout")
if not stdout_attached:
Expand Down
Loading