def create_from_image_id(cls, image_id, name=None): env = Environment(new=True) env._generate_ssh_keys() image = Image.findOne({"id": image_id}) env.docker_id = virtualization.environments.create(image.docker_id, public_key=env.public_key) env.save() return env
def run(argv): image = Image.create_from_tar_stream(sys.stdin.buffer) print("IMAGE ID = %s" % image.id) print("DOCKER ID = %s" % image.docker_id) sys.exit(0)