diff --git a/bin/sdk/assets/baked.sh b/bin/sdk/assets/baked.sh index 7005ef6a4..ad53254af 100755 --- a/bin/sdk/assets/baked.sh +++ b/bin/sdk/assets/baked.sh @@ -97,6 +97,7 @@ function Assets::build() { -f "${DEPLOYMENT_PATH}/images/baked/assets/Dockerfile" \ --progress="${PROGRESS_TYPE}" \ --build-arg "SPRYKER_PARENT_IMAGE=${cliImage}" \ + --build-arg="SPRYKER_PHP_IMAGE=${SPRYKER_PHP_IMAGE:-spryker/php:80}" \ --build-arg "SPRYKER_ASSETS_MODE=${mode}" \ --build-arg "SPRYKER_PIPELINE=${SPRYKER_PIPELINE}" \ --build-arg "SPRYKER_BUILD_HASH=${SPRYKER_BUILD_HASH:-"current"}" \ diff --git a/bin/sdk/images/common.sh b/bin/sdk/images/common.sh index 380ae96d6..449dadc5f 100644 --- a/bin/sdk/images/common.sh +++ b/bin/sdk/images/common.sh @@ -53,6 +53,7 @@ function Images::_buildApp() { -f "${DEPLOYMENT_PATH}/images/common/application/Dockerfile" \ --progress="${PROGRESS_TYPE}" \ --build-arg "SPRYKER_PLATFORM_IMAGE=${SPRYKER_PLATFORM_IMAGE}" \ + --build-arg "SPRYKER_PHP_IMAGE=${SPRYKER_PHP_IMAGE:-spryker/php:80}" \ --build-arg "SPRYKER_LOG_DIRECTORY=${SPRYKER_LOG_DIRECTORY}" \ --build-arg "SPRYKER_PIPELINE=${SPRYKER_PIPELINE}" \ --build-arg "APPLICATION_ENV=${APPLICATION_ENV}" \ @@ -63,6 +64,7 @@ function Images::_buildApp() { --build-arg "SPRYKER_NODE_IMAGE_VERSION=${SPRYKER_NODE_IMAGE_VERSION}" \ --build-arg "SPRYKER_NODE_IMAGE_DISTRO=${SPRYKER_NODE_IMAGE_DISTRO}" \ --build-arg "SPRYKER_NPM_VERSION=${SPRYKER_NPM_VERSION}" \ + --build-arg "SPRYKER_NODE_IMAGE=${SPRYKER_NODE_IMAGE}" \ "${DEPLOYMENT_PATH}/context" 1>&2 docker build \ diff --git a/ci/deploy.dev.yml b/ci/deploy.dev.yml index 90ab58e7b..60ab92340 100644 --- a/ci/deploy.dev.yml +++ b/ci/deploy.dev.yml @@ -4,7 +4,7 @@ namespace: spryker tag: 'dev' environment: docker -image: spryker/php:7.2 +image: ${SPRYKER_CI_PHP_IMAGE:-spryker/php:7.2} regions: EU: diff --git a/ci/deploy.yml b/ci/deploy.yml index cf40837ea..44c79ed60 100644 --- a/ci/deploy.yml +++ b/ci/deploy.yml @@ -4,7 +4,7 @@ namespace: spryker_demo tag: '1.0' environment: docker -image: spryker/php:7.2 +image: ${SPRYKER_CI_PHP_IMAGE:-spryker/php:7.2} regions: EU: diff --git a/generator/Dockerfile b/generator/Dockerfile index d44b258e6..caf8babce 100644 --- a/generator/Dockerfile +++ b/generator/Dockerfile @@ -1,7 +1,8 @@ # syntax = docker/dockerfile:experimental ARG SPRYKER_PHP_VERSION=7.3 +ARG SPRYKER_PHP_IMAGE=spryker/php:${SPRYKER_PHP_VERSION} -FROM spryker/php:${SPRYKER_PHP_VERSION} +FROM ${SPRYKER_PHP_IMAGE} RUN apk add --no-cache openssl diff --git a/generator/deploy-file-generator/Dockerfile b/generator/deploy-file-generator/Dockerfile index eba9890f7..f1fb1e530 100644 --- a/generator/deploy-file-generator/Dockerfile +++ b/generator/deploy-file-generator/Dockerfile @@ -1,7 +1,8 @@ # syntax = docker/dockerfile:experimental ARG SPRYKER_PHP_VERSION=7.3 +ARG SPRYKER_PHP_IMAGE=spryker/php:${SPRYKER_PHP_VERSION} -FROM spryker/php:${SPRYKER_PHP_VERSION} +FROM ${SPRYKER_PHP_IMAGE} WORKDIR /data USER spryker diff --git a/generator/deploy-file-generator/templates/environment/ci/assets.deploy.template.yml b/generator/deploy-file-generator/templates/environment/ci/assets.deploy.template.yml index 37ec4f303..4955f649c 100644 --- a/generator/deploy-file-generator/templates/environment/ci/assets.deploy.template.yml +++ b/generator/deploy-file-generator/templates/environment/ci/assets.deploy.template.yml @@ -1,5 +1,5 @@ assets: - image: fholzer/nginx-brotli:v1.18.0 + image: ${SPRYKER_CI_FRONTEND_IMAGE:-fholzer/nginx-brotli:v1.18.0} mode: production compression: brotli: diff --git a/generator/index.php b/generator/index.php index fe613d920..341d3c587 100644 --- a/generator/index.php +++ b/generator/index.php @@ -165,6 +165,7 @@ public function setIsActive(bool $isActive): void const SPRYKER_NODE_IMAGE_DISTRO_ENV_NAME = 'SPRYKER_NODE_IMAGE_DISTRO'; const SPRYKER_NODE_IMAGE_VERSION_ENV_NAME = 'SPRYKER_NODE_IMAGE_VERSION'; +const SPRYKER_NODE_IMAGE_ENV_NAME = 'SPRYKER_NODE_IMAGE'; const SPRYKER_NPM_VERSION_ENV_NAME = 'SPRYKER_NPM_VERSION'; const DEFAULT_NODE_VERSION = 12; @@ -1619,7 +1620,7 @@ function buildNodeJsNpmBuildConfig(array $projectData): array $imageName = $projectData['image']['tag']; $nodejsConfig = $projectData['image']['node'] ?? []; - return [ + $nodeJsNpmBuildConfig = [ SPRYKER_NODE_IMAGE_DISTRO_ENV_NAME => getNodeDistroName($nodejsConfig, $imageName), SPRYKER_NODE_IMAGE_VERSION_ENV_NAME => array_key_exists('version', $nodejsConfig) ? (int)$nodejsConfig['version'] @@ -1628,6 +1629,10 @@ function buildNodeJsNpmBuildConfig(array $projectData): array ? (int)$nodejsConfig['npm'] : DEFAULT_NPM_VERSION, ]; + + $nodeJsNpmBuildConfig[SPRYKER_NODE_IMAGE_ENV_NAME] = 'node:' . $nodeJsNpmBuildConfig[SPRYKER_NODE_IMAGE_VERSION_ENV_NAME] . '-' . $nodeJsNpmBuildConfig[SPRYKER_NODE_IMAGE_DISTRO_ENV_NAME]; + + return $nodeJsNpmBuildConfig; } /** diff --git a/generator/src/templates/deploy.bash.twig b/generator/src/templates/deploy.bash.twig index 4aa209a02..392b2ffb6 100644 --- a/generator/src/templates/deploy.bash.twig +++ b/generator/src/templates/deploy.bash.twig @@ -121,6 +121,7 @@ readonly SPRYKER_ASSETS_MODE="{{ assets['mode'] | default('development') }}" readonly SPRYKER_DB_ENGINE="{{ services['database']['engine'] == 'mysql' ? 'mysql' : 'pgsql' }}" readonly SPRYKER_STORES=({{ regions | map((regionData, region) => "'local REGION=" ~ '"' ~ region ~ '"' ~ "; local STORES=(" ~ (regionData['stores'] | keys | join(' ')) ~ ")'") | join(' ') | raw }}) readonly SPRYKER_DEFAULT_STORE="{{ (regions | first)['stores'] | keys | first }}" +readonly SPRYKER_ACTIVE_STORES={{ (regionData['stores'] | keys | join(',')) | upper }} readonly SPRYKER_FILE_MODE="{{ _fileMode }}" readonly SPRYKER_XDEBUG_MODE_ENABLE="{{ docker['debug']['xdebug']['enabled'] is not defined or docker['debug']['xdebug']['enabled'] == true ? '1' : '' }}" readonly SPRYKER_SYNC_SESSION_NAME="{{ _syncSessionName }}" diff --git a/generator/src/templates/docker-compose.yml.twig b/generator/src/templates/docker-compose.yml.twig index 4cf290ad0..99f9cb7df 100644 --- a/generator/src/templates/docker-compose.yml.twig +++ b/generator/src/templates/docker-compose.yml.twig @@ -8,7 +8,7 @@ x-volumes: services: cli_ssh_relay: - image: spryker/socat:latest + image: ${SPRYKER_CLI_SSH_RELAY_IMAGE:-spryker/socat:latest} privileged: true command: UNIX-LISTEN:/tmp/ssh-relay/ssh-auth.sock,fork,unlink-early,user=1000,group=1000,mode=666 UNIX-CONNECT:/tmp/ssh-relay/input-ssh-auth.sock networks: diff --git a/generator/src/templates/service/jenkins/2.305/jenkins.yml.twig b/generator/src/templates/service/jenkins/2.305/jenkins.yml.twig index a082b5eb1..3c6ff6255 100644 --- a/generator/src/templates/service/jenkins/2.305/jenkins.yml.twig +++ b/generator/src/templates/service/jenkins/2.305/jenkins.yml.twig @@ -1,5 +1,5 @@ {{ serviceName }}: - image: spryker/jenkins:2.305 + image: ${SPRYKER_CI_JENKINS_IMAGE:-spryker/jenkins:2.305} networks: - private labels: diff --git a/generator/src/templates/service/jenkins/2.324/jenkins.yml.twig b/generator/src/templates/service/jenkins/2.324/jenkins.yml.twig index 4b2ee667a..83470cc76 100644 --- a/generator/src/templates/service/jenkins/2.324/jenkins.yml.twig +++ b/generator/src/templates/service/jenkins/2.324/jenkins.yml.twig @@ -1,5 +1,5 @@ {{ serviceName }}: - image: spryker/jenkins:2.324 + image: ${SPRYKER_CI_JENKINS_IMAGE:-spryker/jenkins:2.324} networks: - private labels: diff --git a/generator/src/templates/service/rabbitmq/3.8/rabbitmq.yml.twig b/generator/src/templates/service/rabbitmq/3.8/rabbitmq.yml.twig index 41a73e3e0..3a5c76bda 100644 --- a/generator/src/templates/service/rabbitmq/3.8/rabbitmq.yml.twig +++ b/generator/src/templates/service/rabbitmq/3.8/rabbitmq.yml.twig @@ -1,5 +1,5 @@ {{ serviceName }}: - image: spryker/rabbitmq:3.8 + image: ${SPRYKER_CI_RABBITMQ_IMAGE:-spryker/rabbitmq:3.8} hostname: {{ serviceName }} # RabbitMQ determines the cluster by its hostname networks: - private diff --git a/generator/src/templates/service/rabbitmq/3.9/rabbitmq.yml.twig b/generator/src/templates/service/rabbitmq/3.9/rabbitmq.yml.twig index d0a6499ab..b2022135c 100644 --- a/generator/src/templates/service/rabbitmq/3.9/rabbitmq.yml.twig +++ b/generator/src/templates/service/rabbitmq/3.9/rabbitmq.yml.twig @@ -1,5 +1,5 @@ {{ serviceName }}: - image: spryker/rabbitmq:3.9 + image: ${SPRYKER_CI_RABBITMQ_IMAGE:-spryker/rabbitmq:3.9} hostname: {{ serviceName }} # RabbitMQ determines the cluster by its hostname networks: - private diff --git a/generator/src/templates/service/swagger-ui/v3.24/swagger-ui.yml.twig b/generator/src/templates/service/swagger-ui/v3.24/swagger-ui.yml.twig index 929cb3ea8..bf6d28ba6 100644 --- a/generator/src/templates/service/swagger-ui/v3.24/swagger-ui.yml.twig +++ b/generator/src/templates/service/swagger-ui/v3.24/swagger-ui.yml.twig @@ -1,7 +1,7 @@ {% set protocol = project['docker']['ssl']['enabled'] ? 'https://' : 'http://' %} {% set firstGlueEndpointMap = project['_endpointMap'] | first %} {{ serviceName }}: - image: spryker/swagger-ui:v3.24.3 + image: ${SPRYKER_CI_SWAGGER_IMAGE:-spryker/swagger-ui:v3.24.3} networks: - private labels: diff --git a/images/common/application/Dockerfile.twig b/images/common/application/Dockerfile.twig index 16f7ea52a..c72ad58b5 100644 --- a/images/common/application/Dockerfile.twig +++ b/images/common/application/Dockerfile.twig @@ -2,8 +2,9 @@ ARG SPRYKER_PLATFORM_IMAGE=spryker/php:7.3 ARG SPRYKER_NODE_IMAGE_VERSION ARG SPRYKER_NODE_IMAGE_DISTRO +ARG SPRYKER_NODE_IMAGE=node:${SPRYKER_NODE_IMAGE_VERSION}-${SPRYKER_NODE_IMAGE_DISTRO} -FROM node:${SPRYKER_NODE_IMAGE_VERSION}-${SPRYKER_NODE_IMAGE_DISTRO} AS node +FROM ${SPRYKER_NODE_IMAGE} AS node ARG SPRYKER_NPM_VERSION diff --git a/images/common/dashboard/Dockerfile b/images/common/dashboard/Dockerfile index d7aaab8d4..672409d5b 100644 --- a/images/common/dashboard/Dockerfile +++ b/images/common/dashboard/Dockerfile @@ -1,4 +1,6 @@ -FROM node:alpine AS dashboard +ARG SPRYKER_DASHBOARD_IMAGE=node:alpine + +FROM ${SPRYKER_DASHBOARD_IMAGE} AS dashboard RUN mkdir -p /dashboard WORKDIR /dashboard diff --git a/images/common/services/jenkins/export/Dockerfile b/images/common/services/jenkins/export/Dockerfile index fb35ff1cf..72b818a48 100644 --- a/images/common/services/jenkins/export/Dockerfile +++ b/images/common/services/jenkins/export/Dockerfile @@ -1,7 +1,8 @@ # syntax = docker/dockerfile:experimental ARG SPRYKER_PARENT_IMAGE +ARG SPRYKER_JENKINS_IMAGE=spryker/jenkins-boilerplate:latest -FROM spryker/jenkins-boilerplate:latest as spryker-jenkins-boilerplate +FROM ${SPRYKER_JENKINS_IMAGE} as spryker-jenkins-boilerplate FROM ${SPRYKER_PARENT_IMAGE} as spryker_jenkins EXPOSE 8080 COPY context/jenkins/export/jenkins.docker.xml.twig ./config/Zed/cronjobs/jenkins.docker.xml.twig @@ -9,7 +10,7 @@ COPY context/jenkins/export/jenkins.docker.xml.twig ./config/Zed/cronjobs/jenkin COPY --from=spryker-jenkins-boilerplate /usr/share/jenkins/ref/plugins /usr/share/jenkins/ref/plugins COPY --from=spryker-jenkins-boilerplate /usr/share/jenkins/jenkins.war /usr/share/jenkins/jenkins.war COPY --from=spryker-jenkins-boilerplate /usr/share/jenkins/jenkins-cli.jar /usr/share/jenkins/jenkins-cli.jar - + # Install packages on Alpine RUN bash -c 'if [ ! -z "$(which apk)" ]; then apk --no-cache add \ curl \ @@ -35,7 +36,7 @@ RUN bash -c 'if [ ! -z "$(which apt)" ]; then apt update -y && \ jq \ && \ mkdir -p /envs \ - ; fi' + ; fi' COPY terraform/cli /envs/ COPY context/jenkins/export/entrypoint.sh /entrypoint.sh