0

I have followed this article https://gist.github.com/cassidydotdk/47eacabd752d7a84e7e5826531fb0f9e

The docker site is writing to the C:\unicorn and the mount volume is set to the D:\Sitecore\Source\unicorn but my helix code structure as below

  1. D:\Sitecore\Source\src\Feature\Account\code
  2. D:\Sitecore\Source\src\Feature\Account\serialization

In the account feature example, the unicorn.yml files should be written to

D:\Sitecore\Source\src\Feature\Account\serialization 

to check in and share with other developers etc however the files from docker are coming to

D:\Sitecore\Source\unicorn\Feature\Account\serialization

There is a disconnect and missing some configuration here,

1
  • 1
    Consider changing your "Helix" serialization structure to match the example provided by Mark's gist. I've found following the pattern by Mark to be easier to package up later on during build/deployment. Commented Oct 2, 2022 at 4:57

1 Answer 1

1

There is no disconnect, but you obviously need to update the Unicorn.TargetDataStore.config to match your Helix-type setup. Which, as Michael points out as well, is not what I would recommend.

In case you are wondering; you're basically going to have to mount your entire .\src directory into your container to expose all the .yml files; make sure you define a very adequate .dockerignore if going down this route.

Also keep in mind; from your question it looks like you may be overlooking this fact; what you define in your Unicorn.TargetDataStore.config is a path relative to your docker container and NOT your source filesystem as it sits on your host machine.

By default, I recommend not deploying a datastore definition to containers at all. This will cause Unicorn to use ~\App_Data\Unicorn as its default. You can then volume mount your .\src directory to here if you like.

All in all though, bottom line, this is a very clunky approach and you really shouldn't be mixing up your serialised content assets with your source code assets. Make your Unicorn root .\Unicorn relative to your GIT repository root, and be done with the hassle.

This best practice is demonstrated in the GIST you linked; here: https://gist.github.com/cassidydotdk/47eacabd752d7a84e7e5826531fb0f9e#file-docker-compose-yml-L7

1
  • Mark , are you suggesting that when using Docker rather than using the conventional helix + unicorn structure shown c:\projects\my-project\src\Feature\Component\code\componentProject.csproj c:\projects\my-project\src\Feature\Component\serialization\always\Templates\componentTemplate.yml The folder structure should be modified to: c:\projects\my-project\src\Feature\Component\code\componentProject.csproj c:\projects\my-project\unicorn\Feature\Component\serialization\always\Templates\componentTemplate.yml ? (apologies for the formatting) Commented Aug 29 at 3:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.