Skip to content

How docker calculates the layer ids #29

Description

@x-yuri

docker-drag/docker_pull.py

Lines 118 to 119 in 5413165

# FIXME: Creating fake layer ID. Don't know how Docker generates it
fake_layerid = hashlib.sha256((parentid+'\n'+ublob+'\n').encode('utf-8')).hexdigest()

For each layer docker creates a v1 config, and a layer id is basically a digest of the v1 config, another layer id, and the parent layer id. If you're interested I can probably describe it more precisely. And possibly how other parts of docker save work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions