def create_container_definition(container_name, image, port=80, cpu=1.0, memgb=1.5,
                                environment=None):
    '''Makes a python dictionary of container properties.

    Args:
        container_name: The name of the container.
        image (str): Container image string. E.g. nginx.
        port (int): TCP port number. E.g. 8080.
        cpu (float): Amount of CPU to allocate to container. E.g. 1.0.
        memgb (float): Memory in GB to allocate to container. E.g. 1.5.
        environment (list): A list of [{'name':'envname', 'value':'envvalue'}].
        Sets environment variables in the container.

    Returns:
        A Python dictionary of container properties, pass a list of these to
        create_container_group().
    '''
    container = {'name': container_name}
    container_properties = {'image': image}
    container_properties['ports'] = [{'port': port}]
    container_properties['resources'] = {
        'requests': {'cpu': cpu, 'memoryInGB': memgb}}
    container['properties'] = container_properties

    if environment is not None:
        container_properties['environmentVariables'] = environment
    return container
Makes a python dictionary of container properties.

    Args:
        container_name: The name of the container.
        image (str): Container image string. E.g. nginx.
        port (int): TCP port number. E.g. 8080.
        cpu (float): Amount of CPU to allocate to container. E.g. 1.0.
        memgb (float): Memory in GB to allocate to container. E.g. 1.5.
        environment (list): A list of [{'name':'envname', 'value':'envvalue'}].
        Sets environment variables in the container.

    Returns:
        A Python dictionary of container properties, pass a list of these to
        create_container_group().