-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed as not planned
Closed as not planned
Copy link
Description
Module
Core
Testcontainers version
1.19.1
Using the latest Testcontainers version?
Yes
Host OS
Alpine Linux v3.18
Host Arch
x86
Docker version
Server Version: 24.0.6What happened?
We use DockerComposeContainer, and builds fail in our CI environment with the following error:
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image docker/compose:1.29.2
Relevant log output
11:24:41.098 [Test worker] ERROR tc.docker/compose:1.29.2 - Log output from the failed container:
Creating network "pbqs5beuh5ua_default" with the default driver
Pulling <name of image> (<registry url>)...
Head "<manifest url>": denied: access forbiddenAdditional Information
Many hours of trial and error revealed the following fix:
Our docker-compose.yml did not contain a "version" element (which is not required by the compose specification). If I add "version: '3'" to my docker-compose.yml file, the build succeeds in the CI environment:
version: '3' # must add this
services:
...
After adding the version element, I see the following log message in our CI environment, which seems to be the main difference between the failing and succeeding builds:
o.t.containers.ComposeDelegate - Preemptively checking local images for '<image name>', referenced via a compose file or transitive Dockerfile. If not available, it will be pulled.
If version is ommitted from docker-compose.yml, testcontainers should assume latest compose file version, or at least log a warning that point us in the right direction.