Skip to content

Commit

Permalink
Update docker-compose.yml.twig (#490)
Browse files Browse the repository at this point in the history
* Update docker-compose.yml.twig

Removing version because of changes in docker version 25.05

* add dynamic version header
  • Loading branch information
Harvara authored May 8, 2024
1 parent 262eee2 commit 7d80bc0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/command/install/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,15 @@ function Command::bootstrap() {
if [ "${USER_FULL_ID%%:*}" != '0' ]; then
userToRun=()
fi

local dockerVersion=`docker version --format json`

docker run -i --rm "${userToRun[@]}" \
-e SPRYKER_PLATFORM_IMAGE="${SPRYKER_PLATFORM_IMAGE:-""}" \
-e SPRYKER_DOCKER_SDK_PLATFORM="${_PLATFORM}" \
-e SPRYKER_DOCKER_SDK_DEPLOYMENT_DIR="${DESTINATION_DIR}" \
-e VERBOSE="${VERBOSE}" \
-e DOCKER_VERSION="${dockerVersion}" \
-v "${tmpDeploymentDir}":/data/deployment:rw \
spryker_docker_sdk

Expand Down
4 changes: 4 additions & 0 deletions generator/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ public function setIsActive(bool $isActive): void
$projectData['secrets'] = buildSecrets($deploymentDir);
$projectData = buildDefaultCredentials($projectData);

$dockerVersionObject = json_decode(getenv('DOCKER_VERSION', '{}'));
$skipVersionHeader = version_compare($dockerVersionObject?->Client?->Version, '26.0.0', '>=');
$projectData['_skipVersionHeader'] = $skipVersionHeader;

// TODO Make it optional in next major
// Making webdriver as required service for BC reasons
// todo: waitFor refactoring dependency + document + testing mode
Expand Down
2 changes: 2 additions & 0 deletions generator/src/templates/docker-compose.yml.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% if not _skipVersionHeader %}
version: "3.7"
{% endif %}

x-volumes:
&app-volumes
Expand Down

0 comments on commit 7d80bc0

Please sign in to comment.