lib/kontena/cli/services/create_command.rb in kontena-cli-1.4.0.pre6 vs lib/kontena/cli/services/create_command.rb in kontena-cli-1.4.0.pre7

- old
+ new

@@ -14,13 +14,17 @@ option ["-e", "--env"], "ENV", "Set environment variables", multivalued: true option ["-l", "--link"], "LINK", "Add link to another service in the form of name:alias", multivalued: true option ["-v", "--volume"], "VOLUME", "Add a volume or bind mount it from the host", multivalued: true option "--volumes-from", "VOLUMES_FROM", "Mount volumes from another container", multivalued: true option ["-a", "--affinity"], "AFFINITY", "Set service affinity", multivalued: true + option "--cpus", "CPUS", "Number of CPUs" do |cpus| + Float(cpus) + end option ["-c", "--cpu-shares"], "CPU_SHARES", "CPU shares (relative weight)" option ["-m", "--memory"], "MEMORY", "Memory limit (format: <number><optional unit>, where unit = b, k, m or g)" option ["--memory-swap"], "MEMORY_SWAP", "Total memory usage (memory + swap), set \'-1\' to disable swap (format: <number><optional unit>, where unit = b, k, m or g)" + option ["--shm-size"], "SHM_SIZE", "Size of /dev/shm (format: <number><optional unit>, where unit = b, k, m or g)" option "--cmd", "CMD", "Command to execute" option "--instances", "INSTANCES", "How many instances should be deployed" option ["-u", "--user"], "USER", "Username who executes first process inside container" option "--stateful", :flag, "Set service as stateful", default: false option "--privileged", :flag, "Give extended privileges to this service", default: false @@ -67,9 +71,11 @@ data[:links] = parse_links(link_list) unless link_list.empty? data[:volumes] = volume_list unless volume_list.empty? data[:volumes_from] = volumes_from_list unless volumes_from_list.empty? data[:memory] = parse_memory(memory) if memory data[:memory_swap] = parse_memory(memory_swap) if memory_swap + data[:shm_size] = parse_memory(shm_size) if shm_size + data[:cpus] = cpus if cpus data[:cpu_shares] = cpu_shares if cpu_shares data[:affinity] = affinity_list unless affinity_list.empty? data[:env] = env_list unless env_list.empty? data[:secrets] = parse_secrets(secret_list) data[:container_count] = instances if instances