Skip to content

Cannot use URL as build context #3780

Closed

Description

@synotna

According to https://docs.docker.com/compose/compose-file/#/context it should be possible to use URL to a git repository for build context, but I am having no luck

docker-py version: 1.8.1
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013

docker-compose.yml

version: '2'
services:
  test:
    build:
      context: https://github.com/docker/compose.git

docker-compose build

Building test
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose/cli/main.py", line 58, in main
  File "compose/cli/main.py", line 109, in perform_command
  File "compose/cli/main.py", line 215, in build
  File "compose/project.py", line 300, in build
  File "compose/service.py", line 719, in build
  File ".tox/py27/lib/python2.7/site-packages/docker/api/build.py", line 104, in build
  File ".tox/py27/lib/python2.7/site-packages/docker/utils/decorators.py", line 46, in inner
AttributeError: 'NoneType' object has no attribute 'update'
docker-compose returned -1

Activity

  1. shin- commented on Jul 29, 2016

    @shin-

    I can't seem to be able to reproduce this on 1.7.1 or 1.8.0. What version of docker-compose are you using? Did you install it through pip, or are you using the binary distribution?

  2. feltraco commented on Aug 1, 2016

    @feltraco

    Hi @shin- , I just tried with 1.8.0.

    $ docker-compose version
    docker-compose version 1.8.0, build f3628c7
    docker-py version: 1.9.0
    CPython version: 2.7.9
    OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
    

    Installed (or download) from https://github.com/docker/compose/releases:

    curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
    chmod +x /usr/local/bin/docker-compose
    

    Running in Ubuntu:

     $ uname -a
    Linux devmachine 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    
    $ docker-compose build
    Building test
    Traceback (most recent call last):
      File "<string>", line 3, in <module>
      File "compose/cli/main.py", line 61, in main
      File "compose/cli/main.py", line 113, in perform_command
      File "compose/cli/main.py", line 219, in build
      File "compose/project.py", line 300, in build
      File "compose/service.py", line 727, in build
      File "site-packages/docker/api/build.py", line 104, in build
      File "site-packages/docker/utils/decorators.py", line 46, in inner
    AttributeError: 'NoneType' object has no attribute 'update'
    docker-compose returned -1
    
  3. shin- commented on Aug 2, 2016

    @shin-

    @feltraco Care to share your compose file? I still can't reproduce the issue using a similar environment.

    $ ls
    docker-compose  docker-compose.yml
    $ ./docker-compose version
    docker-compose version 1.8.0, build f3628c7
    docker-py version: 1.9.0
    CPython version: 2.7.9
    OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
    $ cat docker-compose.yml 
    version: '2'
    services:
      test:
        build:
          context: https://github.com/docker/compose.git
    
    $ uname -a
    Linux yuna 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    $ ./docker-compose build
    Building test
    Step 1 : FROM debian:wheezy
     ---> 2e9c7e5da19c
    [...]
    Successfully built ade0143bebdb
    
  4. shin- commented on Aug 2, 2016

    @shin-

    Oh, nevermind - the issue triggers when you have a HttpHeaders entry in your config.json file.
    I've created issue docker/docker-py#1148 to track its resolution in docker-py, after which we can port the fix in compose.

    Thank you for the report, and thanks for your patience.

  5. added this to the 1.8.1 milestone on Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions