• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python client.inspect_container函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中utils.client.inspect_container函数的典型用法代码示例。如果您正苦于以下问题:Python inspect_container函数的具体用法?Python inspect_container怎么用?Python inspect_container使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了inspect_container函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_docker_run_args

def test_docker_run_args(client, shipy):
    cargs = 'ping -v -c 100 127.0.0.1'
    container = run_template(client, shipy, cargs=cargs)

    assert cargs == '{} {}'.format(
        client.inspect_container(container)['Path'],
        ' '.join(client.inspect_container(container)['Args']))
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例2: test_docker_run_interactive

def test_docker_run_interactive(client, shipy):
    argument = ('-i', '--interactive')

    for farg in argument:
        container = run_template(client, shipy, farg=farg)

        assert client.inspect_container(container)[
            'Config']['AttachStdin']
        assert client.inspect_container(container)[
            'Config']['OpenStdin']
        assert client.inspect_container(container)[
            'Config']['StdinOnce']
开发者ID:abhi1004,项目名称:shipy,代码行数:12,代码来源:test_functional_shipy.py


示例3: test_docker_run_memory_swap

def test_docker_run_memory_swap(client, shipy):
    farg = '--memory-swap'
    fval = ('110M',)

    sarg = '--memory'
    sval = '100M'
    container = run_template(client, shipy, farg=farg, fval=fval,
                             sarg=sarg, sval=sval)

    assert sval == \
           size(client.inspect_container(container)['HostConfig']['Memory'])

    assert fval[0] == \
           size(client.inspect_container(container)['HostConfig']['MemorySwap'])
开发者ID:abhi1004,项目名称:shipy,代码行数:14,代码来源:test_functional_shipy.py


示例4: test_docker_run_add_host

def test_docker_run_add_host(client, shipy):
    farg = '--add-host'
    fval = ('batman.example:10.0.0.1', 'wayne.manor:10.0.0.2')
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert [fval[0], fval[1]] == \
           client.inspect_container(container)['HostConfig']['ExtraHosts']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例5: test_docker_run_cap_drop

def test_docker_run_cap_drop(client, shipy):
    farg = '--cap-drop'
    fval = ('SYS_ADMIN', 'SYS_TIME')
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert [fval[0], fval[1]] == \
           client.inspect_container(container)['HostConfig']['CapDrop']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例6: test_docker_run_dns_search

def test_docker_run_dns_search(client, shipy):
    farg = '--dns-search'
    fval = ('batman.com', 'brucewayne.com')
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert [fval[0], fval[1]] == \
           client.inspect_container(container)['HostConfig']['DnsSearch']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例7: test_docker_run_dns

def test_docker_run_dns(client, shipy):
    farg = '--dns'
    fval = ('8.8.8.8', '8.8.4.4')
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert [fval[0], fval[1]] == \
           client.inspect_container(container)['HostConfig']['Dns']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例8: test_docker_run_links

def test_docker_run_links(client, shipy):
    farg = '--link'
    fval = []

    for _ in range(2):
        fval.append(cn())

    fval[1] += ':alias'

    fval = tuple(fval)

    ext_fval = []

    for linked_to in fval:
        run_template(client, shipy, cn=linked_to.split(':')[0])

        if len(linked_to.split(':')) == 1:
            linked_to += ':{}'.format(linked_to)
        ext_fval.append(linked_to)

    container = run_template(client, shipy, farg=farg, fval=fval)

    links = client.inspect_container(container)['HostConfig']['Links']

    assert len(fval) == len(links)

    for link in links:
        name, _, alias = ''.join(link.split(':')).split('/')[1:]

        assert '{}:{}'.format(name, alias) in ext_fval
开发者ID:abhi1004,项目名称:shipy,代码行数:30,代码来源:test_functional_shipy.py


示例9: test_docker_run_pid

def test_docker_run_pid(client, shipy):
    farg = '--pid'
    fval = ('host',)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           client.inspect_container(container)['HostConfig']['PidMode']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例10: test_docker_run_memory

def test_docker_run_memory(client, shipy):
    farg = '--memory'
    fval = ('100M',)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           size(client.inspect_container(container)['HostConfig']['Memory'])
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例11: test_docker_run_workdir

def test_docker_run_workdir(client, shipy):
    argument = ('-w', '--workdir')
    fval = ('/tmp',)
    for farg in argument:
        container = run_template(client, shipy, farg=farg, fval=fval)
        assert fval[0] == \
               client.inspect_container(container)['Config']['WorkingDir']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例12: test_docker_run_log_driver

def test_docker_run_log_driver(client, shipy):
    farg = '--log-driver'
    fval = ('syslog',)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           client.inspect_container(container)['HostConfig']['LogConfig']['Type']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例13: test_docker_run_cpu_period

def test_docker_run_cpu_period(client, shipy):
    farg = '--cpu-period'
    fval = (1000,)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           client.inspect_container(container)['HostConfig']['CpuPeriod']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例14: test_docker_run_mac_address

def test_docker_run_mac_address(client, shipy):
    farg = '--mac-address'
    fval = ('aa:aa:aa:aa:aa:aa',)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           client.inspect_container(container)['NetworkSettings']['MacAddress']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例15: test_docker_run_volume_driver

def test_docker_run_volume_driver(client, shipy):
    farg = '--volume-driver'
    fval = ('local',)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           client.inspect_container(container)['HostConfig']['VolumeDriver']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例16: test_docker_run_cpu_shares

def test_docker_run_cpu_shares(client, shipy):
    farg = '--cpu-shares'
    fval = (5,)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           client.inspect_container(container)['HostConfig']['CpuShares']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例17: test_docker_run_group_add

def test_docker_run_group_add(client, shipy):
    farg = '--group-add'
    fval = ('wheel',)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           client.inspect_container(container)['HostConfig']['GroupAdd'][0]
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例18: test_docker_run_tty

def test_docker_run_tty(client, shipy):
    argument = ('-t', '--tty')

    for farg in argument:
        container = run_template(client, shipy, farg=farg)

        assert client.inspect_container(container)['Config']['Tty']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例19: test_docker_run_shm_size

def test_docker_run_shm_size(client, shipy):
    farg = '--shm-size'
    fval = ('100M',)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           size(client.inspect_container(container)['HostConfig']['ShmSize'])
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


示例20: test_docker_run_security_opt

def test_docker_run_security_opt(client, shipy):
    farg = '--security-opt'
    fval = ('label=type:svirt_apache_t', 'label=level:s0:c100,c200')
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert [fval[0], fval[1]] == \
           client.inspect_container(container)['HostConfig']['SecurityOpt']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py



注:本文中的utils.client.inspect_container函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python cmd.git函数代码示例发布时间:2022-05-26
下一篇:
Python classes.create_class_directly函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap