Bitbucket pipeline err
Asked Answered
N

4

6

getting the below error in my pipeline. Can anyone help me on this ? Am trying the deploy my ecs service via bitbucket pipelines but facing this error. I tried updating docker, pip, docker-compose everything but no luck

current versions: docker-compose: 1.29.2 pip: 23.3.1 docker: latest

My yaml file code:

          name: "Deployment"
          services:
            - docker
          caches:
            - node
            - docker
          script:
            - pip install awscli docker-compose
            - docker-compose --version
            - aws configure set aws_access_key "${AWS_ACCESS_KEY}"
            - aws configure set aws_secret_key "${AWS_SECRET_KEY}"
            - docker-compose -f ./docker/docker-compose.stg.yml build
            - eval $(aws ecr get-login --no-include-email --region us-east-1 | sed 's;https://;;g')
            - docker push ${DOCKER_REGISTRY}/dashboard-service:stg
            - aws ecs update-service --cluster new-services --service dashboard-service --force-new-deployment```

**ERROR CODE:**
+ docker-compose -f ./docker/docker-compose.stg.yml build
  Traceback (most recent call last):
  File "/usr/local/bin/docker-compose", line 8, in \<module\>
  sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/compose/cli/main.py", line 81, in main
  command_func()
  File "/usr/local/lib/python3.8/site-packages/compose/cli/main.py", line 200, in perform_command
  project = project_from_options('.', options)
  File "/usr/local/lib/python3.8/site-packages/compose/cli/command.py", line 60, in project_from_options
  return get_project(
  File "/usr/local/lib/python3.8/site-packages/compose/cli/command.py", line 152, in get_project
  client = get_client(
  File "/usr/local/lib/python3.8/site-packages/compose/cli/docker_client.py", line 41, in get_client
  client = docker_client(
  File "/usr/local/lib/python3.8/site-packages/compose/cli/docker_client.py", line 124, in docker_client
***  kwargs = kwargs_from_env(environment=environment, ssl_version=tls_version)
  TypeError: kwargs_from_env() got an unexpected keyword argument 'ssl_version'***

Neutralism answered 11/12, 2023 at 6:42 Comment(0)
L
3

The ssl_version parameter is removed in the docker 7.0.0 package because it uses TLSv1.3 by default.

Add constraint to your requirements like "docker<7" as a quick solution.

Liva answered 11/12, 2023 at 10:15 Comment(3)
Works well, and with link to the source. Very nice, thank you!Myriam
@Myriam How or where did you manage to specify the docker version < 7 or so? I have similar script to what's posted in the question.Galba
@Basil right next to docker-compose in the pip install call, the pull request is github.com/hartwork/wnpp.debian.net/pull/874 .Myriam
I
1

It seems after the update of bitbucket over the weekend - you might be using a newer version of docker without knowing it. Here is what works ok for me:



image: docker:23.0.5

options:
  docker: true

definitions:
  steps:
    - step: &build-test
        name: Build and test
        max-time: 10
        caches:
          - docker
        script:
          - export DOCKER_BUILDKIT=0
          - docker compose -f ./docker/docker-compose.stg.yml build

Now Docker supports docker compose so no need to install and use docker-compose anymore

Inwardness answered 11/12, 2023 at 10:49 Comment(4)
Sad buildkit noises but this should be the accepted answer.Manouch
docker-compose is Python and version 1.x while docker compose is Golang and version 2.x. The question above is about Python and version 1.x. Upgrading to 2.x may or may not be an option.Myriam
Compose V1 is deadware, any further use is discouraged. If you can't opt into Compose V2, you have a problem.Manouch
I was using docker:stable so that updated my docker version and docker-compose was not an option anymore. I switched into explicit version of docker to avoid future problems, so that might be causing issue to some people, tooInwardness
N
1

we figured out the issue.

Docker has release latest version as "7.0" which is not supported in bitbucket. So after install docker-compose forcefully install docker 6.1.3 version.

- pip install awscli docker-compose            
- pip install docker==6.1.3
Neutralism answered 11/12, 2023 at 11:13 Comment(1)
How is docker (the-python-library) unsupported in bitbucket?Manouch
N
0

Refer to this article:

https://support.atlassian.com/bitbucket-cloud/docs/use-docker-images-as-build-environments/

image:
  name: atlassian/default-image:3
Novena answered 11/12, 2023 at 10:58 Comment(2)
it's there in code, removed while pastingNeutralism
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Interbedded

© 2022 - 2024 — McMap. All rights reserved.