sitecore / docker-examples Goto Github PK
View Code? Open in Web Editor NEWCompanion code for the Sitecore Containers documentation.
License: MIT License
Companion code for the Sitecore Containers documentation.
License: MIT License
The default Sitecore Compose file (docker-compose.yml
) doesn't configure the cd
service for HTTPS, but the documentation has it being accessed as such. For example: https://containers.doc.sitecore.com/docs/config-transforms#run-docker-examples. This results in a 404 when browsing https://cd.dockerexamples.localhost.
The Compose override files that include the cd
service (docker-compose.xm1.override.yml
and docker-compose.xp1.override.yml
) should have this configured appropriately in Traefik for HTTPS access.
HTTP ERROR 404 javax.servlet.UnavailableException: Error processing the request. CoreContainer is either not initialized or shutting down.
URI: /solr/
STATUS: 404
MESSAGE: javax.servlet.UnavailableException: Error processing the request. CoreContainer is either not initialized or shutting down.
SERVLET: default
CAUSED BY: javax.servlet.ServletException: javax.servlet.UnavailableException: Error processing the request. CoreContainer is either not initialized or shutting down.
CAUSED BY: javax.servlet.UnavailableException: Error processing the request. CoreContainer is either not initialized or shutting down.
I tried running a docker compose up
from getting-started
in this repo (after running ./init.ps1
), and it started solr, mssql, and id, but nothing else, and exited with a message about solr-init
not having a health check. A few more tries resulted in the same error message.
When I changed xconnect to depend on solr
instead of solr-init
(which probably worked since solr-init
had already run once), then a lot more stuff started to happen when I ran docker compose up
.
I think I have discovered an error similar to the one already reported on Twitter in the SiteCore.DevEx.Templates package: https://twitter.com/techphoria414/status/1291763017554825216?s=20
The -AllowPrerelease parameter in the init.ps1 script should probably also be removed.
When trying to run in VS2017 receiving the following build error:
Severity Code Description Project File Line Suppression State
Error Version mismatch: file C:\Users\<user>\docker\sitecore\docker-demo\sitecore\9.0.1 rev. 171219 XM1\VS2017\SimpleSample\docker-compose.yml specifies version 3.0 but extension file C:\Users\<user>\docker\sitecore\docker-demo\sitecore\9.0.1 rev. 171219 XM1\VS2017\SimpleSample\obj\Docker\docker-compose.vs.debug.g.yml uses version 3.4.
For more troubleshooting information, go to http://aka.ms/DockerToolsTroubleshooting docker-compose C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets 316
One suggestion I have for improving the documentation and examples is to explain how Sitecore now uses Configuration Builders to source environment variables for things like connection strings and application keys when starting the site: it's not currently obvious how this works as past deployment scenarios under SIF usually involved MSDeploy transformations of the files on disk. A developer who needs to alter something at runtime (especially if it wasn't already specifically defined in Docker Compose or Kubernetes examples) can be confused as to how some Docker Compose ENV variables are referenced during build and others at runtime.
Thanks,
Alex
After building the container the admin password remains b.
Hi Team,
I just cloned custom-image and trying to execute with following command.
**Please give your comments to resolve my issue.
If you need more details please give your reply
Thanks !
The following volume that uses named pipes are not properly working on docker-compose V2
Running docker-compose up
will produce the following error:
Error response from daemon: Unrecognised volume spec: file '\\.\pipe\docker_engine' cannot be mapped. Only directories can be mapped on this platform
The workaround was to the disable the compose V2 on docker.
The term 'C:toolsentrypointsiisDevelopment.ps1' is not recognized as the
name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:3
+ CategoryInfo : ObjectNotFound: (C:toolsentrypointsiisDevelopmen
t.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Hello,
I'm currently using this repository alongside the Sitecore Commerce Developer's Fundamentals 10 training course. In attempting to execute docker-compose build
in C:\sitecore\docker-examples\custom-images, I eventually receive the following error during the nuget restore step:
Step 13/22 : RUN nuget restore
---> Running in f1172e4564a8
MSBuild auto-detection: using msbuild version '16.10.2.30804' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'.
C:\build\Directory.Build.targets : warning : Unable to load the service index for source https://api.nuget.org/v3/index.json.
C:\build\Directory.Build.targets : warning : Unable to load the service index for source https://sitecore.myget.org/F/sc-packages/api/v3/index.json.
C:\build\Directory.Build.targets : error : Unable to find package Microsoft.Build.CentralPackageVersions. No packages exist with this id in source(s): Nuget, Sitecore
C:\build\Directory.Build.targets : error : C:\Program Files\dotnet\sdk\5.0.301\Sdks\Microsoft.Build.CentralPackageVersions\Sdk not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json.C:\build\Directory.Build.targets : error MSB4236: The SDK 'Microsoft.Build.CentralPackageVersions/2.0.79' specified could not be found. [C:\build\src\DockerExamples.Website\DockerExamples.Website.csproj]
C:\build\Directory.Build.targets : error MSB4236: The SDK 'Microsoft.Build.CentralPackageVersions/2.0.79' specified could not be found. [C:\build\src\DockerExamples.XConnect\DockerExamples.XConnect.csproj]
C:\build\Directory.Build.targets : error MSB4236: The SDK 'Microsoft.Build.CentralPackageVersions/2.0.79' specified could not be found. [C:\build\src\DockerExamples.XConnect.Model\DockerExamples.XConnect.Model.csproj]
C:\build\Directory.Build.targets : error MSB4236: The SDK 'Microsoft.Build.CentralPackageVersions/2.0.79' specified could not be found. [C:\build\src\App.XConnect.ModelBuilder\App.XConnect.ModelBuilder.csproj]
C:\build\Directory.Build.targets : error MSB4236: The SDK 'Microsoft.Build.CentralPackageVersions/2.0.79' specified could not be found. [C:\build\src\App.XConnect.Demo\App.XConnect.Demo.csproj]
The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; nuget restore' returned a non-zero code: 1
ERROR: Service 'solution' failed to build : Build failed
I know that this reference does exist on Nuget.org, so I feel like I must be doing something wrong. Is this an error that is known? If so, can you kindly provide some guidance?
Thank you!
Think I've spotted an issue here - but apologies in advance if this is just me not understanding something.
I've cloned the repo and made some tweaks to simplify it to my needs (just want an XM0 instance, no need for the custom solution container) and I seemed to have it all working. Until I changed my site's name from the default of "dockerexamples" to something else.
I deleted the certs files generated in docker\traefik\certs
and re-ran init.ps1
with my new value for $HostName
. It completes without error, but when I start my containers I now get browser "site is not secure" errors, as it no longer likes the certificate.
Poking about, to try and work out why, I realise that certs_config.yaml
is hard coded to assume the certificate files are named with "dockerexamples" (e.g. _wildcard.dockerexamples.localhost.pem
) but init.ps1
has now generated cert files that have my new site name in them:
If I manually fix the certs_config.yaml
file then it seems to start working again. So should the init script generate the certs config file too, perhaps? Or is there a better way of parameterising that file?
I am creating new custom images based on XP1 yaml files provided here but when i inspect the CM image i find that the connectionstring.config there is having empty values in 3 keys
xconnect.search
xconnect.search.certificate
reporting
<connectionStrings configBuilders="SitecoreConnectionStringsBuilder"> <add name="core" connectionString="user id=user;password=password;Data Source=(server);Database=Sitecore_Core"/> <add name="security" connectionString="user id=user;password=password;Data Source=(server);Database=Sitecore_Security"/> <add name="master" connectionString="user id=user;password=password;Data Source=(server);Database=Sitecore_Master"/> perienceForms"/> <add name="exm.master" connectionString="user id=user;password=password;Data Source=(server);Database=Sitecore_EXM.Master"/> <add name="sitecore.reporting.client" connectionString="https://Sitecore_xconnect/"/> <add name="sitecore.reporting.client.certificate" connectionString="StoreName=My;StoreLocation=CurrentUser;FindType=FindByThumbprint;FindValue="/> <add name="solr.search" connectionString="https://localhost:8995/solr"/> <add name="sitecoreidentity.secret" connectionString="Set client secret for Sitecore Identity server here."/> <add name="xconnect.collection" connectionString="https://Sitecore_xconnect"/> <add name="xconnect.collection.certificate" connectionString="StoreName=My;StoreLocation=LocalMachine;FindType=FindByThumbprint;FindValue="/> <add name="xdb.marketingautomation.operations.client" connectionString="https://Sitecore_xconnect"/> <add name="xdb.marketingautomation.operations.client.certificate" connectionString="StoreName=My;StoreLocation=CurrentUser;FindType=FindByThumbprint;FindValue="/> <add name="xdb.marketingautomation.reporting.client" connectionString="https://Sitecore_xconnect"/> <add name="xdb.marketingautomation.reporting.client.certificate" connectionString="StoreName=My;StoreLocation=CurrentUser;FindType=FindByThumbprint;FindValue="/> <add name="xdb.referencedata.client" connectionString="https://Sitecore_xconnect"/> <add name="xdb.referencedata.client.certificate" connectionString="StoreName=My;StoreLocation=CurrentUser;FindType=FindByThumbprint;FindValue="/> <add name="EXM.CryptographicKey" connectionString="0x0000000000000000000000000000000000000000000000000000000000000000"/> <add name="EXM.AuthenticationKey" connectionString="0x0000000000000000000000000000000000000000000000000000000000000000"/> <add name="PackageManagementServiceUrl" connectionString="https://updatecenter.cloud.sitecore.net/"/> <add name="xconnect.search" connectionString=""/> <add name="xconnect.search.certificate" connectionString=""/> <add name="reporting" connectionString=""/> </connectionStrings>
Great job!
Would be nice if you guys could create a Dockerfile(example) for Publishing Service
Hi,
When I run F5 for the first time it fails saying path is undefined. This is probably because I could not file $env:SITEPATH where it is defined and what value should it have? Exact error mentioned below
Urgent help will be very appreciated.
1>Step 5/9 : RUN Rename-Item -Path $env:SITEPATH -NewName $env:DEFAULTWEBSITENAME; New-Item -Path $env:SITEPATH -ItemType Directory | Out-Null;
1> ---> Running in 1ea8e628a305
Rename-Item : Cannot bind argument to parameter 'Path' because it is null.
1>At line:1 char:94
1>+ ... ference = 'SilentlyContinue'; Rename-Item -Path $env:SITEPATH -NewNam ...
1>+ ~~~~~~~~~~~~~
1> + CategoryInfo : InvalidData: (:) [Rename-Item], ParentContainsEr
1> rorRecordException
1>�[0m�[91m + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,M
1>�[0m�[91m icrosoft.PowerShell.Commands.RenameItemCommand
1>
1>Service 'website' failed to build: The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; Rename-Item -Path $env:SITEPATH -NewName $env:DEFAULTWEBSITENAME; New-Item -Path $env:SITEPATH -ItemType Directory | Out-Null;' returned a non-zero code: 1
1>�[0m
Reproduction Steps:
# escape=`
ARG BASE_IMAGE
ARG SXA_IMAGE
ARG SPE_IMAGE
ARG TOOLING_IMAGE
ARG MANAGEMENT_SERVICES_IMAGE
FROM ${TOOLING_IMAGE} as tooling
FROM ${SPE_IMAGE} as spe
FROM ${SXA_IMAGE} as sxa
FROM ${MANAGEMENT_SERVICES_IMAGE} as management_services
FROM ${BASE_IMAGE}
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# Copy development tools and entrypoint
COPY --from=tooling \tools\ \tools\
WORKDIR C:\inetpub\wwwroot
# Add SPE module
COPY --from=spe \module\cm\content .\
# Add SXA module
COPY --from=sxa \module\cm\content .\
COPY --from=sxa \module\tools \module\tools
RUN C:\module\tools\Initialize-Content.ps1 -TargetPath .\; `
Remove-Item -Path C:\module -Recurse -Force;
#copy the Sitecore Management Services Module
COPY --from=management_services c:\module\cm\content C:\inetpub\wwwroot
# Copy role transforms
COPY .\transforms\ \transforms\role\
# Perform role transforms
#RUN C:\tools\scripts\Invoke-XdtTransform.ps1 -Path .\ -XdtPath C:\transforms\role`
`cm:
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xm1-cm:${VERSION:-latest}
build:
context: ./docker/build/cm
args:
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-cm:${SITECORE_VERSION}
SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-spe-assets:${SPE_VERSION}
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-sxa-xm1-assets:${SXA_VERSION}
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
MANAGEMENT_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-management-services-xp1-assets:${SITECORE_MODULE_VERSION}
depends_on:
- solution
volumes:
- ${LOCAL_DEPLOY_PATH}\website:C:\deploy
- ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs
environment:
SITECORE_DEVELOPMENT_PATCHES: CustomErrorsOff
entrypoint: powershell -Command "& C:\\tools\\entrypoints\\iis\\Development.ps1"`
docker-compose -f docker-compose.xp1.yml -f docker-compose.xp1.override.yml up -d
attempt of building cm image in step COPY --from=managementservices c:\module\cm\content C:\inetpub\wwwroot
always ends with following error:
ERROR: Service 'cm' failed to build: invalid from flag value managementservices: pull access denied for managementservices, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
OS: Windows 11 PRO 23H2 22631.3155
Docker version: Docker Desktop 4.27.1(used Docker-compose in version 1.25.1 as well but with the same result)
Hi,
I cannot run this demo on my machine because I do not have access to the below repository. Can you please suggest a work around?
FROM VSWebsiteRegistry.azurecr.io/sitecore:9.0.171219-xm1-cm
I am getting these error messages at the end. do we need special license file for Sitecore 10 ?
as i used the same one of 8.x
ERROR: for cortexprocessingworker Container "0ee95485f65b" is unhealthy.
ERROR: for xdbautomationworker Container "0ee95485f65b" is unhealthy.
ERROR: for xdbsearchworker Container "0ee95485f65b" is unhealthy.
ERROR: for traefik Container "cf6d26327a49" is unhealthy.
ERROR: Encountered errors while bringing up the project.
HI Team, I am trying to use the Custom-Images with Solution Service As-Is, but not able to bring up the containers. I did not do any customization and using the exact same solution.
When tryig to bring up the containers, I see below error message in the CM and xConnect Containers.
Service 'w3svc' has been stopped
APPCMD failed with error code 259
Failed to update IIS configuration
[LOGMONITOR] INFO: Entrypoint processs exit code: -2147467259.
Could you please help me on getting this resolved as we are planning to start the Dockers development.
I followed instructions found here:
https://doc.sitecore.com/en/developers/100/developer-tools/deploying-files-into-running-containers.html
It worked once for me. After deleting everything and starting over, I get the following errors:
PS C:\sitecore\docker-examples\custom-images> docker-compose up -d
[+] Running 32/41
Steps to reproduce:
master
or develop
branch.\init.ps1 -LicenseXmlFile c:\license\license.xml
custom-images\docker
.\clean.ps1
to make sure that there are no artifacts from previous timescustom-images
docker-compose up -d
Expected result: containers up and running
Actual result:
Creating docker-examples_solr_1 ... done
Creating docker-examples_mssql_1 ... done
Creating docker-examples_mssql-init_1 ... done
Creating docker-examples_solr-init_1 ... done
Creating docker-examples_xconnect_1 ... done
Creating docker-examples_id_1 ... done
Creating docker-examples_cm_1 ... done
Creating docker-examples_hrz_1 ... done
ERROR: for traefik Container "a544e3fe3ff7" is unhealthy.
ERROR: for xdbsearchworker Container "6b2cc5dcc865" is unhealthy.
ERROR: for cortexprocessingworker Container "6b2cc5dcc865" is unhealthy.
ERROR: for xdbautomationworker Container "6b2cc5dcc865" is unhealthy.
ERROR: Encountered errors while bringing up the project.
I ignore traefik as it will be unhealthy if at least one container is unhealthy
Investigations:
docker logs 6b2cc5dcc865
(xdbsearchworker)Error present in logs:
2022-01-18 10:30:59.886 +02:00 [Error] Health check "XConnect SolrCloud cluster live collection health check" completed after 26.9359ms with status Unhealthy and '"SolrCloud Cluster health check failed."
2022-01-18 10:32:00.534 +02:00 [Error] Health check "XConnect SolrCloud cluster live collection health check" completed after 1.8999ms with status Unhealthy and '"SolrCloud Cluster health check failed."'
I'm trying to setup a Sitecore XP 10.1.2 single instance development machine, but I'm encountering an issue with the 10.1.0.1 release/tag of the docker-examples solution.
Steps to reproduce:
Expected result:
The containers get build and start successfully.
Actual result:
The docker-compose up command exits with the following errors:
Creating network "docker-examples_default" with the default driver
Creating docker-examples_mssql_1 ... done
Creating docker-examples_solr_1 ... done
Creating docker-examples_solr-init_1 ... done
Creating docker-examples_xconnect_1 ... done
Creating docker-examples_id_1 ... done
Creating docker-examples_cm_1 ... done
Creating docker-examples_hrz_1 ... done
ERROR: for traefik Container "1465a1989acf" is unhealthy.
ERROR: for xdbautomationworker Container "f08699d12809" is unhealthy.
ERROR: for xdbsearchworker Container "f08699d12809" is unhealthy.
ERROR: for cortexprocessingworker Container "f08699d12809" is unhealthy.
ERROR: Encountered errors while bringing up the project.
Additional information:
Container "f08699d12809" is the xconnect container. When checking the logs for that container, the following errors are displayed in the logs:
2022-09-05 08:52:18.848 +00:00 [Error] Health check "XConnect SolrCloud cluster live collection health check" completed after 3.1796ms with status Unhealthy and '"SolrCloud Cluster health check failed."'
2022-09-05 08:52:18.926 +00:00 [Error] Health check "XConnect SolrCloud cluster live collection health check" completed after 3.4757ms with status Unhealthy and '"SolrCloud Cluster health check failed."'
2022-09-05 08:52:33.401 +00:00 [Error] Health check "processing engine tasks" completed after 14543.2824ms with status Unhealthy and '"Error message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"'
2022-09-05 08:52:33.401 +00:00 [Error] Health check "processing engine tasks" completed after 14465.6735ms with status Unhealthy and '"Error message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"'
When checking the docker\data\solr folder, there are no solr indexes present.
While running the init script I'm getting this error, I'm running powershell as administrator.
Populating required .env file variables...
Downloading and installing mkcert certificate tool...
Generating Traefik TLS certificates...
Using the local CA at "C:\Users\hello\AppData\Local\mkcert" ✨
ERROR: add cert: Failed adding cert: Access is denied.
Using the local CA at "C:\Users\hello\AppData\Local\mkcert" ✨
Warning: the local CA is not installed in the system trust store! ⚠️
Warning: the local CA is not installed in the Java trust store! ⚠️
Run "mkcert -install" to avoid verification errors ‼️
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.