diff --git a/docs/reference/docker/README.md b/docs/reference/docker/README.md index 585a3bbb..fef82bae 100644 --- a/docs/reference/docker/README.md +++ b/docs/reference/docker/README.md @@ -57,8 +57,7 @@ Load a docker image into a docker engine | Name | Type | Description | | ------------- |:-------------: |:-------------: | -|*ref* | `string` |Image ref | -|*digest* | `string` |Image digest | +|*id* | `string` |Image ID | ## docker.#Pull diff --git a/environment/pipeline.go b/environment/pipeline.go index 1f7854e3..ee751939 100644 --- a/environment/pipeline.go +++ b/environment/pipeline.go @@ -914,22 +914,13 @@ func (p *Pipeline) SaveImage(ctx context.Context, op *compiler.Value, st llb.Sta return st, err } - if digest, ok := resp.ExporterResponse["containerimage.digest"]; ok { - imageRef := fmt.Sprintf( - "%s@%s", - resp.ExporterResponse["image.name"], - digest, - ) - + if id, ok := resp.ExporterResponse["containerimage.config.digest"]; ok { st = st.File( llb.Mkdir("/dagger", fs.FileMode(0755)), llb.WithCustomName(p.vertexNamef("Mkdir /dagger")), ).File( - llb.Mkfile("/dagger/image_digest", fs.FileMode(0644), []byte(digest)), - llb.WithCustomName(p.vertexNamef("Storing image digest to /dagger/image_digest")), - ).File( - llb.Mkfile("/dagger/image_ref", fs.FileMode(0644), []byte(imageRef)), - llb.WithCustomName(p.vertexNamef("Storing image ref to /dagger/image_ref")), + llb.Mkfile("/dagger/image_id", fs.FileMode(0644), []byte(id)), + llb.WithCustomName(p.vertexNamef("Storing image id to /dagger/image_id")), ) } diff --git a/stdlib/docker/docker.cue b/stdlib/docker/docker.cue index 198a12b3..b2c9882b 100644 --- a/stdlib/docker/docker.cue +++ b/stdlib/docker/docker.cue @@ -155,28 +155,15 @@ import ( command: "docker load -i /src/image.tar" } - // Image ref - ref: { + // Image ID + id: { string #up: [ op.#Load & {from: save}, op.#Export & { - source: "/dagger/image_ref" - }, - ] - } & dagger.#Output - - // Image digest - digest: { - string - - #up: [ - op.#Load & {from: save}, - - op.#Export & { - source: "/dagger/image_digest" + source: "/dagger/image_id" }, ] } & dagger.#Output