From c42f440f9807e51f79e56fc1f5b4bb501ec8c183 Mon Sep 17 00:00:00 2001 From: Laurent Stacul Date: Fri, 3 Jan 2020 09:07:04 +0000 Subject: [PATCH] Fix image reference in tutorial 4 Signed-off-by: Laurent Stacul Closes: #2059 Approved by: rhatdan --- docs/tutorials/04-include-in-your-build-tool.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/04-include-in-your-build-tool.md b/docs/tutorials/04-include-in-your-build-tool.md index 549e4a02e..5b6186b50 100644 --- a/docs/tutorials/04-include-in-your-build-tool.md +++ b/docs/tutorials/04-include-in-your-build-tool.md @@ -70,7 +70,7 @@ builder.SetCmd([]string{"node", "/home/node/script.js"}) Before completing the build, create the image reference: ```go -imageRef, err := alltransports.ParseImageName("docker.io/myusername/my-image") +imageRef, err := is.Transport.ParseStoreReference(buildStore, "docker.io/myusername/my-image") ``` Now you can run commit the build: @@ -102,7 +102,7 @@ import ( "fmt" "github.com/containers/buildah" "github.com/containers/common/pkg/unshare" - "github.com/containers/image/v5/transports/alltransports" + is "github.com/containers/image/v5/storage" "github.com/containers/image/v5/types" "github.com/containers/storage" ) @@ -147,7 +147,11 @@ func main() { builder.SetCmd([]string{"node", "/home/node/script.js"}) - imageRef, err := alltransports.ParseImageName("docker.io/myusername/my-image") + imageRef, err := is.Transport.ParseStoreReference(buildStore, "docker.io/myusername/my-image") + + if err != nil { + panic(err) + } imageId, _, _, err := builder.Commit(context.TODO(), imageRef, buildah.CommitOptions{})