diff --git a/bin/sdk/assets/baked.sh b/bin/sdk/assets/baked.sh index 7005ef6a4..230891850 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:8.2}" \ --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 8d7103834..323255761 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:8.2}" \ --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 \ @@ -72,6 +74,7 @@ function Images::_buildApp() { --secret "id=secrets-env,src=$SECRETS_FILE_PATH" \ --progress="${PROGRESS_TYPE}" \ --build-arg "SPRYKER_PARENT_IMAGE=${baseAppImage}" \ + --build-arg "SPRYKER_PHP_IMAGE=${SPRYKER_PHP_IMAGE:-spryker/php:8.2}" \ --build-arg "SPRYKER_DOCKER_PREFIX=${SPRYKER_DOCKER_PREFIX}" \ --build-arg "SPRYKER_DOCKER_TAG=${SPRYKER_DOCKER_TAG}" \ --build-arg "USER_UID=${USER_FULL_ID%%:*}" \ @@ -199,6 +202,7 @@ function Images::_buildGateway() { -t "${gatewayImage}" \ -f "${DEPLOYMENT_PATH}/images/common/gateway/Dockerfile" \ --progress="${PROGRESS_TYPE}" \ + --build-arg "SPRYKER_GATEWAY_IMAGE=${SPRYKER_GATEWAY_IMAGE:-nginx:stable-bullseye}" \ "${DEPLOYMENT_PATH}/context" 1>&2 } diff --git a/ci/deploy.dev.yml b/ci/deploy.dev.yml index 90ab58e7b..f9cfbb2f6 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:8.2} regions: EU: diff --git a/ci/deploy.yml b/ci/deploy.yml index cf40837ea..b2cddfccc 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:8.2} regions: EU: diff --git a/generator/Dockerfile b/generator/Dockerfile index d44b258e6..d8f583412 100644 --- a/generator/Dockerfile +++ b/generator/Dockerfile @@ -1,7 +1,8 @@ # syntax = docker/dockerfile:experimental -ARG SPRYKER_PHP_VERSION=7.3 +ARG SPRYKER_PHP_VERSION=8.2 +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..ed788a5fe 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_VERSION=8.2 +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 5bee23e51..fa2180c36 100644 --- a/generator/src/templates/deploy.bash.twig +++ b/generator/src/templates/deploy.bash.twig @@ -110,10 +110,10 @@ declare -a -r SPRYKER_APPLICATIONS=({{ _applications | join(' ') | raw }}) declare -a -r SPRYKER_ENTRYPOINTS=({{ _entryPoints | join(' ') | raw }}) readonly COMPOSE_PROJECT_NAME={{ namespace | default('spryker') }} readonly SPRYKER_PIPELINE=${SPRYKER_PIPELINE:-{{ pipeline | default('docker') }}} -readonly SPRYKER_PLATFORM_IMAGE=${SPRYKER_PLATFORM_IMAGE:-{{ image is iterable ? image['tag'] : image | default('spryker/php:7.2') }}} +readonly SPRYKER_PLATFORM_IMAGE=${SPRYKER_PLATFORM_IMAGE:-{{ image is iterable ? image['tag'] : image | default('spryker/php:8.2') }}} readonly SPRYKER_DOCKER_PREFIX=${COMPOSE_PROJECT_NAME} readonly SPRYKER_DOCKER_TAG="{{ tag | default('1.0') }}" -readonly SPRYKER_FRONTEND_IMAGE="{{ assets['image'] | default('nginx:alpine') }}" +readonly SPRYKER_FRONTEND_IMAGE=${SPRYKER_FRONTEND_IMAGE:-{{ assets['image'] | default('nginx:alpine') }}} readonly SPRYKER_COMPOSER_MODE="{{ composer.mode | default('') }}" readonly SPRYKER_COMPOSER_AUTOLOAD="{{ composer.autoload | default('') }}" readonly SPRYKER_LOG_DIRECTORY="{{ docker['logs']['path'] | default('/var/log/spryker') }}" 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..4709adaf8 100644 --- a/images/common/application/Dockerfile.twig +++ b/images/common/application/Dockerfile.twig @@ -1,9 +1,10 @@ # syntax = docker/dockerfile:experimental -ARG SPRYKER_PLATFORM_IMAGE=spryker/php:7.3 +ARG SPRYKER_PLATFORM_IMAGE=spryker/php:8.2 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 79b6f904b..1bd6230ee 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:2.471 -FROM spryker/jenkins-boilerplate:2.471 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