Sitecore / Sitecore/docker-examples

Failed to build custom image when Management Module is included

Open Beginner friendly
#67 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
82
Forks
110
Avg merge
7d 59m
Merged PRs (30d)
1

Description

Reproduction Steps:

  1. modify cm Dockerfile to use Management Module image:
# 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`
  1. modify cm node in docker-compose.xp1.override.yml
`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"`
  1. add SITECORE_MODULE_VERSION to .env
    SITECORE_MODULE_VERSION=5.1.25-1809
  2. run following command using terminal in administrator mode:
    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)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with docker/build/cm/Dockerfile and docker-compose.xp1.override.yml, then compare the Management Services build argument with the image name used by the COPY step. Reproduce with the supplied docker-compose command and verify that the cm image builds successfully with SITECORE_MODULE_VERSION=5.1.25-1809.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, powershell
Domain
build-system, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.