Understand the skopeo-experimental-image-proxy communication protocol
mainThe proxy uses a SOCK_SEQPACKET socket for control messages and pipe(2) for large data payloads (manifests and blobs).
Message Formats
Request Format (JSON):
{ "method": "MethodName", "args": [arguments] }Reply Format (JSON):
{ "success": boolean, "value": JSONValue, "pipeid": number, "error_code": string, "error": string }success:trueif the call succeeded,falseotherwise.value: The return value of the method (e.g., an image ID or digest).pipeid: An integer identifying a pipe for data transfer. This ID must be used with theFinishPipemethod.error_code: A string indicating the error type (e.g.,EPIPE,retryable,other). Introduced in version0.2.8.error: A string describing the error.
Data Transfer Lifecycle
- The client sends a request via the socket.
- The server replies with a JSON object containing a
pipeidand thevalue. - The server passes the read-end of a pipe via file descriptor (FD) passing.
- The client reads the data from the passed FD.
- Crucial: After consuming all data, the client must call
FinishPipewith the correspondingpipeid. This allows the server to clean up and report errors (like digest mismatches) that occurred during streaming.