parse_line.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:DockerSecurityResearch 作者: puyangsky 项目源码 文件源码
def from_parser(body):
    node = Node()
    node.name = "from"
    node.value = body
    # print("FROM:" + body)
    items = body.split(":")
    system = str(items[0]).strip()
    tag = str(items[1]).strip()
    if system not in constants.systems:
        # ?????base image
        base_dockerfile = docker_fetcher.fetch(system, tag, 1)
        if len(base_dockerfile) <= 0:
            return None
        base_parser = parser.Parser(base_dockerfile)
        return base_parser.root
    else:
        if system not in system_count.keys():
            system_count[system] = 1
        else:
            system_count[system] += 1
        print(system)
    return node
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号