{"id":1543,"date":"2023-08-04T02:48:31","date_gmt":"2023-08-04T02:48:31","guid":{"rendered":"https:\/\/www.qedge.co\/blog\/?p=1543"},"modified":"2025-01-15T07:03:59","modified_gmt":"2025-01-15T07:03:59","slug":"how-to-set-up-docker-for-xm-cloud-dev","status":"publish","type":"post","link":"https:\/\/www.qedge.ai\/blog\/how-to-set-up-docker-for-xm-cloud-dev.html","title":{"rendered":"How to Set Up Docker for XM Cloud Dev"},"content":{"rendered":"\n<p>How to Set up Docker for XM Cloud Dev in a <a href=\"https:\/\/www.qedge.co\/blog\/full-stack-local-xm-cloud-dev-environment.html\" target=\"_blank\" rel=\"noreferrer noopener\">Full-Stack Local XM Cloud Dev Environment<\/a>?  No worries. QEdge will walk you through the whole process of a local XM Cloud development environment using Docker.<\/p>\n\n\n\n<p>This Docker for XM Cloud Dev Tutorial is written by Yongmao Yu, a <a href=\"https:\/\/www.qedge.co\/blog\/sitecore-content-hub-administrator-certification.html\" target=\"_blank\" rel=\"noopener\">Sitecore Content Hub Administrator Certification<\/a> winner and experienced developer from Qedge.<\/p>\n\n\n\n<p>Yongmao, we really appreciate your effort!<\/p>\n\n\n\n<p>So, let's get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Dos and Donts while running Local Docker<\/h2>\n\n\n\n<p>Check for port conflicts with Solr on your local machine. Adjust port mapping in the docker-compose.yml file according to the actual situation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1470\" height=\"160\" src=\"https:\/\/www.qedge.co\/blog\/wp-content\/uploads\/2023\/08\/Check-for-port-conflicts-with-Solr-on-your-local-machine.png\" alt=\"Check for port conflicts with Solr on your local machine\" class=\"wp-image-1552\"\/><\/figure>\n\n\n\n<p>Check the ports occupied by local solr<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-Process -Id (Get-NetTCPConnection -LocalPort 8984).OwningProcess<\/code><\/pre>\n\n\n\n<p>Stop the service that occupies the port<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Stop-Service -Name \"&lt;the name of your service&gt;\"<\/code><\/pre>\n\n\n\n<p>local IIS service needs to be stopped<\/p>\n\n\n\n<p>check if port 443 is occupied<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-Process -Id (Get-NetTCPConnection -LocalPort 443).OwningProcess<\/code><\/pre>\n\n\n\n<p>Since iis occupies port 443 , the local iis service needs to stop<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>iisreset \/stop<\/code><\/pre>\n\n\n\n<p>Do Not Run VPN<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Run Docker<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>.\\init.ps1 -InitEnv -LicenseXmlPath \"&lt;C:\\path\\to\\license.xml&gt;\" -AdminPassword \"&lt;desired password&gt;\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>.\\up.ps1<\/code><\/pre>\n\n\n\n<p><strong>Now, Let's pull data from the remote to the local docker<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Item serialization configuration<\/h2>\n\n\n\n<p>Add serialization configuration file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"$schema\": \"..\/..\/.sitecore\/schemas\/ModuleFile.schema.json\",\n    \"namespace\": \"Play\",\n    \"items\": {\n        \"includes\": &#91;\n            {\n                \"name\": \"xaplaceholder\",\n                \"path\": \"\/sitecore\/layout\/Placeholder Settings\/Foundation\/JSS Experience Accelerator\/Placeholder Settings\",\n                \"allowedPushOperations\": \"CreateUpdateAndDelete\"\n            },\n            {\n                \"name\": \"placeholder\",\n                \"path\": \"\/sitecore\/layout\/Placeholder Settings\/Project\",\n                \"allowedPushOperations\": \"CreateUpdateAndDelete\"\n            },\n            {\n                \"name\": \"rendering\",\n                \"path\": \"\/sitecore\/layout\/Renderings\/Project\",\n                \"allowedPushOperations\": \"CreateUpdateAndDelete\"\n            },\n            {\n                \"name\": \"templates\",\n                \"path\": \"\/sitecore\/Templates\/Project\",\n                \"allowedPushOperations\": \"CreateUpdateAndDelete\"\n            },\n            {\n                \"name\": \"contentRoot\",\n                \"path\": \"\/sitecore\/content\/Play\",\n                \"allowedPushOperations\": \"CreateUpdateAndDelete\"\n            },\n            {\n                \"name\": \"media\",\n                \"path\": \"\/sitecore\/Media Library\/Project\/Play\",\n                \"allowedPushOperations\": \"CreateUpdateAndDelete\"\n            }\n        ]\n    }\n}<\/code><\/pre>\n\n\n\n<p><strong>Commands( from logging in XM Cloud to connecting to the current project\/environment after login)<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Login\ndotnet sitecore cloud login\n\/\/get project list\ndotnet sitecore cloud project list\n\/\/obtain envirment based on project id\ndotnet sitecore cloud environment list --project-id &lt;project-id&gt;\n\/\/connect\ndotnet sitecore cloud environment connect -id &lt;environment-id&gt; --allow-write true<\/code><\/pre>\n\n\n\n<p>After a successful connection, you can see that .sitecore\/user.json will have an endpoint after successful connection<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"880\" height=\"409\" src=\"https:\/\/www.qedge.co\/blog\/wp-content\/uploads\/2023\/08\/an-endpoint-after-successful-connection.png\" alt=\"an endpoint after successful connection\" class=\"wp-image-1555\"\/><\/figure>\n\n\n\n<p>Connect to docker local environment (local environment)<br>Note: before running the local connection command, you need to run .\\up.ps1 to start the docker service and make sure that <a href=\"https:\/\/xmcloudcm.localhost\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/xmcloudcm.localhost\/<\/a> can be accessed normally, and you need to turn off VPN<\/p>\n\n\n\n<p>The following is the Sitecore local environment before syncing the online XM Cloud<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1255\" src=\"https:\/\/www.qedge.co\/blog\/wp-content\/uploads\/2023\/08\/Sitecore-local-environment.png\" alt=\"Sitecore local environment \" class=\"wp-image-1556\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>dotnet sitecore connect --ref xmcloud --cm https:\/\/xmcloudcm.localhost --allow-write true -n local<\/code><\/pre>\n\n\n\n<p>After a successful connection, the local endpoint will be added to user.json<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1293\" height=\"603\" src=\"https:\/\/www.qedge.co\/blog\/wp-content\/uploads\/2023\/08\/the-local-endpoint-is-added-to-json.png\" alt=\"the local endpoint is added to json\" class=\"wp-image-1557\"\/><\/figure>\n\n\n\n<p>After configuring remote (xmc-test-demo) and local (local) nodes, you can run the sync command to sync the rermote and local items<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dotnet sitecore ser pull -n \"xmc-test-demo\"\ndotnet sitecore ser push -n \"local\"<\/code><\/pre>\n\n\n\n<p>After the synchronization is complete, the Play node will be added to the local Sitecore's content tree <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1244\" src=\"https:\/\/www.qedge.co\/blog\/wp-content\/uploads\/2023\/08\/the-Play-node-is-added-to-the-local-Sitecores-content-tree.png\" alt=\"the Play node will be added to the local Sitecore's content tree \" class=\"wp-image-1558\"\/><\/figure>\n\n\n\n<p>It should be noted that when executing the synchronization command, you need to close the VPN software, otherwise the command to synchronize to the local docker will report an error:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"713\" height=\"62\" src=\"https:\/\/www.qedge.co\/blog\/wp-content\/uploads\/2023\/08\/the-local-docker-reports-an-error.png\" alt=\"the local docker will report an error\" class=\"wp-image-1559\"\/><\/figure>\n\n\n\n<p><a href=\"https:\/\/www.linkedin.com\/company\/33247506\" data-type=\"link\" data-id=\"https:\/\/www.linkedin.com\/company\/33247506\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>QEdge LinkedIn Page<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Set up Docker for XM Cloud Dev in a Full-Stack Local XM Cloud Dev Environment? No worries. QEdge will walk you through the whole process of a local XM Cloud development environment using Docker. This Docker for XM Cloud Dev Tutorial is written by Yongmao Yu, a Sitecore Content Hub Administrator Certification winner [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1562,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[23,27,24,28,63],"class_list":["post-1543","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-sitecore-development","tag-sitecore-implementation","tag-sitecore-maintenance","tag-sitecore-partner","tag-sitecore-xm-cloud"],"views":6569,"_links":{"self":[{"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/posts\/1543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/comments?post=1543"}],"version-history":[{"count":12,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/posts\/1543\/revisions"}],"predecessor-version":[{"id":7727,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/posts\/1543\/revisions\/7727"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/media\/1562"}],"wp:attachment":[{"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/media?parent=1543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/categories?post=1543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/tags?post=1543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}