1

I am trying to deploy some custom changes in Sitecore identity server in docker environment for xp0 which includes a dll and some config changes. It works fine in non docker environment but I am getting error while deploying it in docker. Any idea how to fix this

The error is: `

Creating sc_id_1         ... error
ERROR: for sc_id_1  Cannot start service id: container 23212ef4141818014d2fbce23b1949f2756b0ff86dcaa59a5d8e7b9ad0544121 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2)
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]

ERROR: for id  Cannot start service id: container 23212ef4141818014d2fbce23b1949f2756b0ff86dcaa59a5d8e7b9ad0544121 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2)
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent.exe!00007FF6DBFE9FCB: (caller: 00007FF6DBF9E19A) Exception(1) tid(38c) 80070002 The system cannot find the file specified.
    CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess]
 Provider: 00000000-0000-0000-0000-000000000000]
ERROR: Encountered errors while bringing up the project.

My docker for for identity server looks like:

# escape=`

ARG BASE_IMAGE
ARG TOOLING_IMAGE


FROM ${TOOLING_IMAGE} as tooling
FROM ${BASE_IMAGE}
 
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
 
# Copy development tools and entrypoint
COPY --from=tooling \tools\ \tools\
COPY .\servicestart.ps1 \service\

And docker-compose.override file contains:

id:
    environment:
      WORKER_EXECUTABLE_NAME_ENV: servicestart.ps1  
    image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-id:${VERSION:-latest}
    build:
      context: ./docker/build/id
      args:
        BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id7:${SITECORE_VERSION}
        TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
    volumes:
      - ${LOCAL_DEPLOY_PATH}\id:C:\deploy
        
    entrypoint: powershell -Command "& C:\tools\entrypoints\worker\Development.ps1 @{ Path= \"C:\\deploy\"; Destination = \"C:\\identity\"; }"
2
  • I never had any success using the development entrypoint May 19, 2023 at 9:42
  • Actually development works for me because I used it for xconnect custom deployment where it works. I feel there is something wrong with the line 'COPY .\servicestart.ps1 \service\' in docker file. May 19, 2023 at 10:01

1 Answer 1

0

The base image for sitecore-id7 has changed and is now using windows/nanoserver which only has pwsh not powershell.

The next issue you'll run into is that robocopy is not available which is required by C:\tools\entrypoints\worker\Development.ps1.

If you change it to use mcr.microsoft.com/dotnet/aspnet:6.0-windowsservercore as the base image so that you have robocopy, it will appear to work but then you run into a fundamental issue that the web server process has to be restarted to pick up any changes anyway.

So you're better off not using this file watcher at all and just build a custom image with your code.

In case you really want to get this file watcher to work:

docker-compose.override

id:
  image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-id:${VERSION:-latest}
  build:
    context: ./docker/build/id
    args:
      BASE_IMAGE: mcr.microsoft.com/dotnet/aspnet:6.0-windowsservercore-${EXTERNAL_IMAGE_TAG_SUFFIX}
      ID_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id7:${SITECORE_VERSION}
      TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
  volumes:
    - ${LOCAL_DEPLOY_PATH}\identityserver:C:\deploy
    - ${LOCAL_DATA_PATH}\identityserver:C:\Identity\logs
  environment:
    WORKER_EXECUTABLE_NAME_ENV: Start.ps1    
  healthcheck:
    test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"]
    timeout: 300s
  entrypoint: powershell -Command "& C:\\tools\\entrypoints\\worker\\Development.ps1 -WatchDirectoryParameters @{ Path = \"C:\\deploy\"; Destination = \"C:\\Identity\"; }"

docker\build\id\Dockerfile

# escape=`

ARG BASE_IMAGE
ARG ID_IMAGE
ARG TOOLING_IMAGE

FROM ${TOOLING_IMAGE} as tooling
FROM ${ID_IMAGE} as id
FROM ${BASE_IMAGE}


SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

COPY --from=id \Identity\ \Identity\
COPY --from=id \Healthchecks\ \Healthchecks\

# Copy development tools and entrypoint
COPY --from=tooling \tools\ \tools\
COPY .\tools\entrypoints\Start.ps1 \service\

USER ContainerAdministrator
EXPOSE 80

docker\build\id\tools\entrypoints\Start.ps1

dotnet.exe c:\identity\Sitecore.IdentityServer.Host.dll

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.