Ejemplo n.º 1
0
def create_dict_test():
    url = '114.212.87.52:2376'
    version = '1.21'
    volume = None
    network = None

    dic = {}
    dic['image'] = 'training/webapp'
    dic['container_name'] = 'test'
    # dic['command'] = '/bin/sleep 30'
    dic['hostname'] = 'testhostname'
    dic['mem_limit'] = '24m'
    dic['ports'] = [80, 8000]
    dic['cpu_shares'] = 3

    volume = Volume(['/home/monkey/fuli:/fuli:rw', '/home/monkey/fire:/fire'])
    network = Network('test', 'bridge')
    dic['privileged'] = True

    con = Container(url, version, dic, volume, network)
    con.create()
    con.start()