1.3. コンテナーレジストリーへの認証
イメージをプライベートコンテナーレジストリーにプッシュするには、それぞれの namespace でシークレットを定義し、Build
カスタムリソース (CR) で参照する必要があります。
手順
以下のコマンドを実行してシークレットを生成します。
$ oc --namespace <namespace> create secret docker-registry <container_registry_secret_name> \ --docker-server=<registry_host> \ 1 --docker-username=<username> \ 2 --docker-password=<password> \ 3 --docker-email=<email_address>
次のコマンドを実行して、シークレットにアノテーションを付けます。
$ oc --namespace <namespace> annotate secrets <container_registry_secret_name> build.shipwright.io/referenced.secret='true'
spec.output.pushSecret
フィールドの値をBuild
CR のシークレット名に設定します。apiVersion: shipwright.io/v1beta1 kind: Build metadata: name: buildah-golang-build # ... output: image: <path_to_image> pushSecret: <container_registry_secret_name>