---
title: "Sitecore Commerce Container SDK"
slug: "sitecore-commerce-container-sdk"
abstract: "Sitecore Experience Commerceコンテナソフトウェア開発キットの内容を説明します。"
---
# Sitecore Commerce Container SDK

Sitecore Commerce Container SDKは、コンテナ化されたCommerceソリューションを扱うための開発者の出発点を提供します。

SDKパッケージには、Dockerファイル、環境変数ファイル、Docker compose YAMLファイル、Kubernetes YAMLファイル、そして使用・修正可能なサンプルスクリプトなどのリソースが含まれています。

-   コンテナを使って開発者ワークステーションにSitecore XCをインストールしてください。
-   Sitecore Experience Commerce(XC)コンテナをAzure Kubernetesサービスに展開します。
-   [カスタマイズされたCommerceソリューションから独自のコンテナセットを構築しましょう。](https://doc.sitecore.com/xp/ja/developers/101/sitecore-experience-commerce/workflow-for-creating-custom-commerce-container-images.html "Workflow for creating custom Commerce container images")

Sitecore.Commerce.Container.SDK.\*.ZIPパッケージおよびサポートするインストールガイドは[Sitecore Downloads](https://dev.sitecore.net/Downloads/Sitecore_Commerce.aspx)のウェブサイトで入手可能です。

## Sitecore Commerce Container SDKの構造

Sitecore.Commerce.Container.SDK.\*.ZIPパッケージは複数のフォルダに分かれており、特定のトポロジーでSitecore XCをデプロイするために必要なアーティファクトを含むものもあれば、複数の構成で共有される共通ファイルを含むフォルダもあります。

最上位では、Sitecore.Commerce.Container.\*.ZIPパッケージには以下のフォルダが含まれています:

フォルダ名

概要

*K8S-Commerce-XC1*

Kubernetes XC1展開トポロジーに必要なファイルを含みます。

*Postman*

DockerまたはKubernetesで動作するCommerceデプロイメントで使用するためのPostman環境ファイルのサンプルセット(JSON形式)を含みます。

*文字*

Dockerを使ったSitecore Experience Commerceコンテナ画像の作成を促進するサポートスクリプトとJSONファイルのセットを例として含んでいます。  
  
また、各スクリプトの目的を説明するREADMEファイルも含まれています。

*XC0*

XC0トポロジーでSitecore XCインスタンスを構築・実行するためのファイルが含まれており、Commerce Engineのデプロイ専用です。  
  
\> \[!注\]  
\> 開発者向けワークステーション用のXC0トポロジーには、SXAストアフロントやサポートモジュール用のコンテナイメージは含まれていません。  
\> SXAストアフロントをサポートするために必要なモジュールを含む展開には、XC1-CXAトポロジーをインストールする必要があります。

*XC1*

Sitecore XC1トポロジーイメージを構築するために使用されたファイルが含まれています。XC1トポロジーは、SXA Storefrontをサポートするモジュールを除外したスケール型デプロイメント用です。このトポロジーは、SXA Storefrontを使わないスケールされたCommerce Engineのみのデプロイで使用されます。  
  
\> \[!注\]  
\> Sitecore Commerce Container SDKには、XC1トポロジーのコンテナイメージを展開するために必要なすべてのDocker YAML(YAML)ファイルを構成するものは含まれていません。

*XC1-CXA*

XC1トポロジーでSitecore XCインスタンスを構築し実行するために必要なファイルを含みます。このデプロイメントトポロジーにはSXA Storefrontが含まれます。

*XC-コモン*

共通Sitecore XC画像を作成するために必要なファイルが含まれています。  
  
\> \[!注\]  
\>共通像はすべてのSitecore XC位相で使用されます。

xc-resources

他のSitecore XCイメージを構築する際に使用するベースリソースを含みます。

### xc-resourcesフォルダ

xc-resourcesフォルダにはすべての基本設定、変換、スクリプト、共通ツールが含まれています。xc-resourcesイメージはローカルで構築し、他のSitecore XCコンテナイメージが提供されるベースリソースを消費できるように、必ず最初にビルドしなければなりません。

以下はxc-resourcesフォルダー構造の例を示しています:

+ xc-resource
    + resources
       + configs
       + content
       + tools
          + scripts
    + Dockerfile
    + .env
    + docker-compose.build.yml

### The xc-common folder

The \`xc-common\` folder contains all files necessary to build Sitecore XC images common to all default deployment topologies included the SDK.

The following shows an example of the \`xc-common\` folder structure:

+ xc-common
 + service
 + Dockerfile
 + ...
 + .env
 + docker-compose.build.yml

#### The \\service\\ folder

Each of the \`service\` folders:

- Represents a container
- Contains at minimum a \`Dockerfile\`.
- Is used as the Docker build context for the corresponding service in the Docker Compose file.

#### The Docker compose build YAML file

The \`docker-compose.build.yml\` file defines images build for the following services, used in both XC0 and XC1 deployment topologies:

> !note
> Images in this folder have to be build before images located in the \`xc0\` , \`xc1\`, and \`xc1-cxa\` folders.

- \`id\`
- \`bizfx \`
- \`engine \`

### The xc0 folder

The \`xc0\` folder contains all the files necessary to build and run Sitecore XC0 topology images.

The following shows an example of the \`xc0\` folder structure:

+ xc0
 + service
 + ...
 + ...
 + .env
 + docker-compose.build.yml
 + docker-compose.yml

#### The \\service\\ folder

Each of the \`service\` folders:

- Represents a container.
- Is used as the Docker build context for the corresponding service in the Docker Compose file.

#### The docker compose build YAML file

The \`docker-compose.build.yml\` file defines images build for the following services:

- \`mssql non-production\`
- \`solr non-production\`
- \`cm\`
- \`xconnect\`
- \`xdbsearchworker\`
- \`xdbautomationworker\`

The \`docker-compose.yml\` contains information about all containers required for a XC0 instance.

### The xc1 folder

The \`xc1\` folder contains all files necessary to build XC1 topology images.

The following shows an example of the \`xc1\` folder structure:

+ xc1
 + service
 + ...
 + ...
 + .env
 + docker-compose.build.yml

#### The \\service\\ folder

Each of the \`service\` folders:

- Represents a container.
- Is used as the Docker build context for the corresponding service in the Docker Compose file.

#### The docker compose build YAML file

The \`docker-compose.build.yml\` file defines images build for the following services:

> !note
> Images in this folder have to be build before images contained in the \`xc1-cxa\` folders.

- \`mssql non-production\`
- \`mssql-init\`
- \`solr non-production\`
- \`solr-init\`
- \`rep\`
- \`xdbcollection\`
- \`prc\`
- \`cm\`
- \`cd\`
- \`xdbsearch\`
- \`xdbsearchworker\`
- \`xdbautomation\`
- \`xdbautomationworker\`

### The xc1-cxa folder

The \`xc1-cxa\` folder contains all files necessary to build and run XC1 topology images, including the SXA storefront.

The following shows an example of the \`xc1-cxa\` folder structure:

+ xc1
 + service
 + ...
 + ...
 .env
 commerce.build.yml
 docker-compose.build.yml
 docker-compose.yml

#### The \\service\\ folder

Within the \`xc1-cxa\` folder, each of the \`service\` folders:

- Represents a container.
- Contains at minimum a \`Dockerfile\`.
- Is used as the Docker build context for the corresponding service in the Docker Compose file.

#### The Commerce build YAML file

The \`commerce.build.yml\` file defines Commerce images build for the following services.

#### The docker compose build YAML file

The \`docker-compose.build.yml\` file defines images build for the following services:

- \`mssql non-production\`
- \`mssql-init\`
- \`solr non-production\`
- \`solr-init\`
- \`cd\`
- \`cm\`

 > !note
 > The \`cm\` and \`cd\` images include Sitecore PowerShell Extensions (SPE)(https://doc.sitecorepowershell.com/) and Sitecore Experience Accelerator (SXA)(https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/index-en.html)

#### The docker compose YAML file

The \`docker-compose.yml\` file contains information about all containers required for a XC1 instance.

### The Scripts folder

This \`scripts\` folder contains a set of support scripts and JSON files that facilitate the creation of the Sitecore Experience Commerce container images using Docker.

The following table lists and briefly describes the content the of \`scripts\` folder.

> !note
> Refer to the \`readme.md\` file included within the \`script\` folder for more details. Script files themselves are also commented with additional information and guidance.

| File | Description |
| --- | --- |
| \`CleanContainerCache.ps1\` | Script used to clean the Docker container images cache. The container images cache is used to speed any action that requires container images to be pulled from a registry. Examples of Docker commands that use the container images cache include : \`docker pull\`, \`docker-compose up\`, \`docker-compose build\`. |
| \`ContainerBuild.ps1\` | Script used to build container images based on the contents of the \`docker-compose.build.yml\` files. The results are container images with the tag "latest". |
| \`ContainerTag.ps1\` | Script used to tag container images based on the provided tag value. |
| \`PrepContainerBuild.ps1\` | Script that takes the Sitecore Experience Commerce Release Package artifacts and expands them into the source code directory structure. |
| \`UpdateEnvTag.ps1\` | Script that sets the container image registry, namespace, project and tag of container images. |
| \`UpdateEnvCompose.ps1\` | Script that updates a \`/topology/.env \`file with provided values. |
| \`UpdateK8SYaml.ps1\` | Script that sets Kubernetes secrets files with values from the \`configltsc2019.json\` file. Kubernetes is only supported in a Windows LTSC 2019 environment. |
| \`ScriptSupport.psm1\` | Script that contains supporting functions used by other script files. |
| \`WDPMapping.json\` | File used by the \`PrepContainerBuild.ps1\` script. This file contains mapping information that is used to place the content of the release package artifacts in the correct location to be use when running the \`docker-compose build\` command. |
| \`configltsc2019.json\`<br><br>\`config20H2.json\`<br><br>\`config2004.json\`<br><br>\`config2009.json\` | Files used by the update scripts \`UpdateEnvTag.ps1\`, \`UpdateEnvCompose.ps1\`, and\` UpdateK8SYaml.ps1\` to override or replace tokens in the \`.env\` and \`yml\` files. This allows the files to be customized for use in the build and run processes. |
| \`FakeLicenseFile.txt\` | File that contains a fake license. |
| \`CreateCertsXC0.cmd\`<br><br>\`CreateCertsXC1-CXA.cmd\` | Scripts that create the appropriate certificates for the various deployment topology. |

#### WDPs mapping

The \`WDPMapping.json\` file contains mapping information that is used to place the WDP packages that are part of the Sitecore XC release package in the appropriate folder structure for use by the Docker compose build process.

The \`WDPMapping.json\` is used by the \`PrepContainerBuild.ps1\` script.

In the following mapping example, the content of the \`"Content/Website"\` folder within the listed WDPs packages will be copied to the destination folder \`xc1-cxa/cd/wdp\` within the \` Sitecore.Commerce.Container.SDK\` folder.

> !note
> The \`WDPMapping.json\` lists WDPs with similar names starting with the the WDP with the most exclusive package name, and ending with the least exclusive package name.

\`\`\`csharp
{
 "WDPs": 
 "Sitecore Commerce Experience Accelerator Storefront Themes",
 "Sitecore Commerce Experience Accelerator Storefront",
 "Sitecore Commerce Experience Accelerator"
 ,
 "DestinationFolder": "xc1-cxa/cd/wdp",
 "ToCopyFolder": "Content/Website"
}

以下の例では、リストWDPパッケージ内の.dacpacファイルがSitecore.Commerce.Container.SDKフォルダ内のxc1-cxa/mssql/dacpacs宛先フォルダにコピーされます。宛先フォルダ内のmaster、core、webに一致する.dacpacファイルは、それぞれSitecore.Master、Sitecore.Core、Sitecore.Webに名前が変更されます。

{
 "WDPs": 
 "Sitecore Commerce Experience Accelerator Habitat Catalog",
 "Sitecore Commerce Experience Accelerator Storefront Themes",
 "Sitecore Commerce Experience Accelerator Storefront",
 "Sitecore Commerce Experience Accelerator"
 ,
 "DestinationFolder": "xc1-cxa/mssql/dacpacs",
 "ToCopyFiles": "\*.dacpac",
 "NameMappings": 
 {"Name":"master", "NewName":"Sitecore.Master"},
 {"Name":"core", "NewName":"Sitecore.Core"},
 {"Name":"web", "NewName":"Sitecore.Web"}
 
}