From 6201e9bd96ce9e43694e64e9a204ac8d890c38c2 Mon Sep 17 00:00:00 2001 From: Pavel Busko Date: Wed, 21 Dec 2022 16:47:22 +0100 Subject: [PATCH] docs(cnbBuild): fix `containerImageAlias` examples (#4171) --- cmd/cnbBuild_generated.go | 2 +- resources/metadata/cnbBuild.yaml | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cmd/cnbBuild_generated.go b/cmd/cnbBuild_generated.go index 300c43d73..45c8f7ec0 100644 --- a/cmd/cnbBuild_generated.go +++ b/cmd/cnbBuild_generated.go @@ -223,7 +223,7 @@ func addCnbBuildFlags(cmd *cobra.Command, stepConfig *cnbBuildOptions) { cmd.Flags().StringVar(&stepConfig.ContainerImageName, "containerImageName", os.Getenv("PIPER_containerImageName"), "Name of the container which will be built\n`cnbBuild` step will try to identify a containerImageName using the following precedence:\n\n 1. `containerImageName` parameter.\n 2. `project.id` field of a `project.toml` file.\n 3. `git/repository` parameter of the `commonPipelineEnvironment`.\n 4. `github/repository` parameter of the `commonPipelineEnvironment`.\n\nIf none of the above was found - an error will be raised.\n") cmd.Flags().StringVar(&stepConfig.ContainerImageAlias, "containerImageAlias", os.Getenv("PIPER_containerImageAlias"), "Logical name used for this image.\n") cmd.Flags().StringVar(&stepConfig.ContainerImageTag, "containerImageTag", os.Getenv("PIPER_containerImageTag"), "Tag of the container which will be built") - cmd.Flags().StringVar(&stepConfig.ContainerRegistryURL, "containerRegistryUrl", os.Getenv("PIPER_containerRegistryUrl"), "Container registry where the image should be pushed to") + cmd.Flags().StringVar(&stepConfig.ContainerRegistryURL, "containerRegistryUrl", os.Getenv("PIPER_containerRegistryUrl"), "Container registry where the image should be pushed to.\n\n**Note**: `containerRegistryUrl` should include only the domain. If you want to publish an image under `docker.io/example/my-image`, you must set `containerRegistryUrl: \"docker.io\"` and `containerImageName: \"example/my-image\"`.\n") cmd.Flags().StringSliceVar(&stepConfig.Buildpacks, "buildpacks", []string{}, "List of custom buildpacks to use in the form of `$HOSTNAME/$REPO[:$TAG]`.") cmd.Flags().StringVar(&stepConfig.Path, "path", os.Getenv("PIPER_path"), "Glob that should either point to a directory with your sources or one artifact in zip format.\nThis property determines the input to the buildpack.\n") diff --git a/resources/metadata/cnbBuild.yaml b/resources/metadata/cnbBuild.yaml index 8d23e2cc4..bfe7909d4 100644 --- a/resources/metadata/cnbBuild.yaml +++ b/resources/metadata/cnbBuild.yaml @@ -83,7 +83,10 @@ spec: - name: dockerRegistryUrl type: string mandatory: true - description: Container registry where the image should be pushed to + description: | + Container registry where the image should be pushed to. + + **Note**: `containerRegistryUrl` should include only the domain. If you want to publish an image under `docker.io/example/my-image`, you must set `containerRegistryUrl: "docker.io"` and `containerImageName: "example/my-image"`. scope: - GENERAL - PARAMETERS @@ -217,16 +220,16 @@ spec: ```yaml containerImageTag: latest - containerRegistryUrl: docker.io/example + containerRegistryUrl: docker.io dockerConfigJsonCredentialsId: CREDENTIALS multipleImages: - - containerImageName: java-app - alias: java + - containerImageName: example/java-app + containerImageAlias: java buildpacks: - "gcr.io/paketo-buildpacks/java" path: "source/java" - - containerImageName: nodejs-app - alias: nodejs + - containerImageName: example/nodejs-app + containerImageAlias: nodejs containerImageTag: v1.0.0 buildpacks: - "gcr.io/paketo-buildpacks/nodejs"