Featured Post
Mind the order of instructions in a Dockerfile for Sitecore Containers
- Get link
- Other Apps
The Sitecore provides flexibility and different deployment for Sitecore development, and one of the modern ways is Docker Container based Sitecore development and deployment to Kubernetes.
Sitecore provides full support for deploying solutions in a containerized environment of your choice and knowledge articles.
There are some cases which are project specific and may not be covered in Sitecore Official Documentations, and in this blog, I will be sharing one of the use case.
In Sitecore Experience Platform, there are flavours which can be utilized by individuals to deploy the application as per their need like Sitecore XP Single/Sitecore XP Scaled/Sitecore XM Scaled , and according to these topologies sometime you have to deploy files into Specific Sitecore Roles.
The deployment of files mostly depends upon the way you have designed/structured your project code base. Some will follow three layered architecture/ Sitecore helix principles / Sitecore Helix Project Solution Template. Based on your requirements, you will write a logic into a specific layer. In my case, I have some configuration which needs to be deployed into a specific Sitecore Role in Containers from one image to a different image and different role. The Visual Solution structure is like:
├── src # Main Source Folder ├── Environment # Environment related code base ├── platform # Source files which deployed to CM and CD ├── sitecore # Source files which deployed to CM ├── xdbcollection # Source files which deployed to xdbcollection ├── docker # Source files for docker build ├── build # Docker build related files ├── cd # CD Build folder ├── cm # CM Build folder ├── xdbcollection # xDBCollection Build folder ├── xdbsearch # xDBSearch Build folder ├── docker-compose.override.yml # Custom docker-compose file ├── Dockerfile # Main Docker build file |
For example, some configuration file which also needs to be xDBSearch which is present in xdbcollection source folder and deployed to xdbcollection role only via xdbcollection deployment.
I have tried to explain the flow of Main Docker Build file, which will build required artifacts and copy to specific environment folder in Solution Image, which is later used to build different Sitecore Containers:
Every Sitecore role has their own Dockerfile which will be used to deploy required artifacts on top of base/parent Sitecore Role image.
Our requirement is to deploy xDBCollection related artifacts into xDBSearch Role. The default xDBCollection and xDBSearch docker file:
Now, we have to deploy models from xConnect folder from Solution Image into xDBSearch. In this case, we have to update the xDBSearch Dockerfile present at \docker\build\xdbsearch\Dockerfile:
If you execute the docker-compose command, then you will get the following error :
COPY --from=solution /artifacts/xconnect/App_Data/Models/ ./App_Data/Models/ invalid from flag value solution: pull access denied for solution, repository does not exist or may require 'docker login': denied: requested access to the resource is denied ERROR: Service 'xdbsearch' failed to build : Build failed |
The above error was encountered due to the wrong order of image used in Sitecore xDBSearch Dockerfile, e.g. we are trying to access the Solution image after the Parent image.
To resolve the error, we have to provide the correct order of images which we wanted to use:
By considering the correct order, you can deploy any file from any image into any Sitecore Roles.Run your first Sitecore instance | Build Sitecore solutions | Docker icons created by Freepik - Flaticon |
Container icons created by Nhor Phai - Flaticon | Cloud icons created by kosonicon - Flaticon |
- Get link
- Other Apps
Comments