mirror of
https://github.com/containers/buildah.git
synced 2026-02-05 09:45:38 +01:00
Fix image reference in tutorial 4
Signed-off-by: Laurent Stacul <laurent.stacul@gmail.com> Closes: #2059 Approved by: rhatdan
This commit is contained in:
committed by
Atomic Bot
parent
8d41b83622
commit
c42f440f98
@@ -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{})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user