-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Bitbucket pipelines fail after upgrading from 4.0.0 to 4.1.0 #10
Comments
I think the issue is related to the Docker.DotNet update. After a quick search, it seems there are several different issues that can cause the access authorization plugin to fail. It might be a good idea to create a reproducer using Docker.DotNet and use it to debug the pipeline. I suspect the issue is either due to the Docker Engine API version update or, more likely, the migration from Json.NET to System.Text.Json. It probably makes more sense to create the issue in the forked version of Docker.DotNet. Unfortunately, I do not have access to a Bitbucket pipeline and cannot look into it. However, here is how you can create a container instance using the plain Docker.DotNet API. I hope this helps you or someone identify the root cause. const string image = "postgres:15.3";
// TODO: Set the Docker host address according to your Bitbucket Pipelines environment.
using var dockerClientConfiguration = new DockerClientConfiguration(new Uri("npipe://./pipe/docker_engine"));
using var dockerClient = dockerClientConfiguration.CreateClient();
await dockerClient.Images.CreateImageAsync(new ImagesCreateParameters { FromImage = image }, new AuthConfig(), new Progress<JSONMessage>());
await dockerClient.Containers.CreateContainerAsync(new CreateContainerParameters { Image = image }); Edit: If you're okay with it, I will move the issue to the Docker.DotNet repository. |
Thanks for the feedback @HofmeisterAn and work on this awesome library Happy for you to move the issue to Docker.DotNet 👍 For now we have no issue or pressing need to upgrade |
I understand; Bitbucket Pipeline users will need a fix to benefit from further bug fixes, improvements, and features. Just something to keep in mind for the future. |
Someone reached out to me on Slack and mentioned they were in contact with Atlassian support. The support team indicated that the issue is related to incompatible Docker versions. Bitbucket is using an older version (25.0.3), whereas we recently upgraded to version 27.3.1. Docker 25.0 supports a maximum API version of 1.44, while Docker 27.3 supports API version 1.47. The Docker client allows specifying an API version. If someone can verify that downgrading the API version resolves the issue, we can enhance Testcontainers to support the var dockerClient = new DockerClientConfiguration(new Uri("<host>")).CreateClient(new Version(1, 44));
// TODO: Pull an image and create a container instance. |
Updating to 4.1.0... This is the docker log from Bitbucket I tried what you suggested with DockerClientConfiguration But I got these errors (I tried 1.44 and 1.41 same errors) time="2025-02-03T06:59:16Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/_ping Hope this can help, thanks for your package is really cool |
I just took a quick look at the logs. Are you trying to pull the image from a private registry? If so, you need to include the credentials. If the image already exists and is cached, you can skip pulling it or simply use a publicly available image like |
Testcontainers version
4.1.0
Using the latest Testcontainers version?
Yes
Host OS
Linux
Host arch
x86
.NET version
9.0.102
Docker version
Docker info
What happened?
Today I updated to 4.1.0
Locally everything is fine, however, in bitbucket pipelines, TestContainer errors out.
I have a 4.0.0 rollback hotfix branch, and it works correctly.
The resource reaper is disabled in BitBucket
This is what our bitbucket-pipelines step looks like
Relevant log output
pipeline logs:
docker logs (for failed 4.1.0):
docker logs (for success 4.0.0):
Additional information
No response
The text was updated successfully, but these errors were encountered: