FS#57550 - docker-compose up --build fails because a recent version of python-docker

Attached to Project: Community Packages
Opened by Iván Perdomo (katratxo) - Saturday, 17 February 2018, 17:12 GMT
Last edited by Doug Newgard (Scimmia) - Saturday, 17 February 2018, 17:22 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

A recent version the Docker Python SDK (>2.7.0) seems to break docker-compose 1.19.0 that has a build definition. This issue is not reproducible when the docker-compose.yml does not have a build definition.

Additional info:

* docker-compose version: 1.19.0-1
* A similar issue has been reported in other project: https://github.com/ansible/ansible/issues/35612
* In Arch's docker-compose package, the requirements.txt gets modified [1] and the package docker version 2.7.0 [2] gets modified to install the most recent 3.0.1
* The workaround is to downgrade docker-python dependency to be 2.7.0

[1] https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/docker-compose&id=cc256c3ad90bff8eadd32e38a4367738db4af5f8#n26
[2] https://github.com/docker/compose/blob/1.19.0/requirements.txt#L5


Steps to reproduce:

## Install docker docker-compose
## Make sure you're part of the docker group or you access the Docker service with sudo

pacman -S docker docker-compose

## Create a docker-compose.yml that contains a build process, e.g

cd /tmp

cat > docker-compose.yml <<EOF
> version: "3"
>
> services:
> db:
> build: postgres
> expose:
> - 5432
> environment:
> - POSTGRES_DB=demo
> - POSTGRES_PASSWORD=sa
>EOF

mkdir postgres

cat > postgres/Dockerfile <<EOF
> FROM postgres:9.6
>
> RUN set -ex; echo "dummy command"
>EOF

## Start the service

docker-compose up --build
Building db
Traceback (most recent call last):
File "/bin/docker-compose", line 11, in <module>
load_entry_point('docker-compose==1.19.0', 'console_scripts', 'docker-compose')()
File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 71, in main
command()
File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 124, in perform_command
handler(command, command_options)
File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 1001, in up
to_attach = up(False)
File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 997, in up
renew_anonymous_volumes=options.get('--renew-anon-volumes')
File "/usr/lib/python3.6/site-packages/compose/project.py", line 463, in up
svc.ensure_image_exists(do_build=do_build)
File "/usr/lib/python3.6/site-packages/compose/service.py", line 310, in ensure_image_exists
self.build()
File "/usr/lib/python3.6/site-packages/compose/service.py", line 989, in build
'memory': parse_bytes(memory) if memory else None
TypeError: build() got an unexpected keyword argument 'stream'

## Workaround (downgrade python-docker to 2.7.0-1)

pacman -U /var/cache/pacman/pkg/python-docker-2.7.0-1-any.pkg.tar.xz

## Start

docker-compose up --build
Building db
Step 1/2 : FROM postgres:9.6
---> c7cca23b4760
Step 2/2 : RUN set -ex; echo "dummy command"
---> Using cache
---> bcd374e8197b
Successfully built bcd374e8197b
Successfully tagged tmp_db:latest
Starting tmp_db_1 ... done
Attaching to tmp_db_1
db_1 | LOG: database system was shut down at 2018-02-17 17:07:37 UTC
db_1 | LOG: MultiXact member wraparound protections are now enabled
db_1 | LOG: autovacuum launcher started
db_1 | LOG: database system is ready to accept connections

This task depends upon

Closed by  Doug Newgard (Scimmia)
Saturday, 17 February 2018, 17:22 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#57546 

Loading...