-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Module
Core
Testcontainers version
1.19.3
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host Arch
x64
Docker version
Client:
Cloud integration: v1.0.31
Version: 20.10.23
API version: 1.41
Go version: go1.18.10
Git commit: 7155243
Built: Thu Jan 19 17:43:10 2023
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Desktop 4.17.1 (101757)
Engine:
Version: 20.10.23
API version: 1.41 (minimum version 1.12)
Go version: go1.18.10
Git commit: 6051f14
Built: Thu Jan 19 17:32:04 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.18
GitCommit: 2456e983eb9e37e47538f59ea18f2043c9a73640
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0What happened?
If pull is set to true in the ComposeContainer/DockerComposeContainer, all images in the docker-compose file should be pulled if they are not available locally. For this purpose, all images returned by parsedComposeFile.getServiceNameToImageNames() are pulled in the ComposeDelegate. However, if the version attribute is not set in the docker-compose file, which is no longer necessary, the map returned by parsedComposeFile.getServiceNameToImageNames() is empty, so no images are pulled.
Cause:
In the ParsedDockerComposeFile, the services are only parsed correctly if the composeFileContent contains the version key. Otherwise, the composeFileContent is set as the serviceMap, which results in the service names being interpreted as service definitions.
Suggested Fix:
Remove else block and limit the upper if block to the validation of the version only.
Relevant log output
No response
Additional Information
Example:
docker-compose.yml:
services:
api:
image: $CI_REGISTRY/api:latest
ports:
- 8000:8000
State of the variables in ParsedDockerComposeFile:93:
