Skip to content
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

Unable to fig build a github repo / works with docker build #491

Closed
techniq opened this issue Sep 19, 2014 · 4 comments
Closed

Unable to fig build a github repo / works with docker build #491

techniq opened this issue Sep 19, 2014 · 4 comments
Labels
Milestone

Comments

@techniq
Copy link

techniq commented Sep 19, 2014

Using docker build I can pull and build an image directly from Github, for example:
docker build -t java https://github.com/StrictlyBusiness/docker-java8.git

When I try to do the same using fig build and the following fig.yml:

webapp:
  build: https://github.com/StrictlyBusiness/docker-java8.git

it shows Building webapp... then after ~40 seconds, it shows just a single closing bracket ). For example:

$ fig build
Building webapp...
)

I haven't found a way to get any more details on what's happening behind the scenes in fig to know why it's failing.

@techniq techniq changed the title Unable to pull a github repo / works with docker build Unable to fig build a github repo / works with docker build Sep 19, 2014
@dnephin
Copy link

dnephin commented Sep 20, 2014

I've been able to reproduce this. It looks like the https:// is cauing a

APIError: 500 Server Error: Internal Server Error (")").

For some reason, the docker client either strips the https or knows how to deal with it.

If you change your fig.yml to:

webapp:
  build: github.com/StrictlyBusiness/docker-java8.git

It will work.

I think fig should probably also know how to strip the scheme (or at least emulate whatever the docker client is doing), and probably also handle these 500 errors better by reporting more details (that it was a 500 internal server error).

@techniq
Copy link
Author

techniq commented Sep 21, 2014

@dnephin - Removing the protocol fixed my simple case I had reported, but I'm running into a related issue trying to pull a private repo. I'm using a machine user with a personal access token with the url USERNAME:TOKEN@github.com/user/some-private-repo.git and it fails the same way. I'm not sure if this is more of a docker client issue, or something fig can help with (at least reporting better).

@techniq
Copy link
Author

techniq commented Sep 21, 2014

Also, stripping the protocol with the username:token url dumps the following stacktrace:

$ fig build
Building webapp...
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/code/build/fig/out00-PYZ.pyz/fig.cli.main", line 30, in main
  File "/code/build/fig/out00-PYZ.pyz/fig.cli.docopt_command", line 21, in sys_dispatch
  File "/code/build/fig/out00-PYZ.pyz/fig.cli.command", line 31, in dispatch
  File "/code/build/fig/out00-PYZ.pyz/fig.cli.docopt_command", line 24, in dispatch
  File "/code/build/fig/out00-PYZ.pyz/fig.cli.command", line 50, in perform_command
  File "/code/build/fig/out00-PYZ.pyz/fig.cli.docopt_command", line 27, in perform_command
  File "/code/build/fig/out00-PYZ.pyz/fig.cli.main", line 115, in build
  File "/code/build/fig/out00-PYZ.pyz/fig.project", line 161, in build
  File "/code/build/fig/out00-PYZ.pyz/fig.service", line 366, in build
  File "/code/build/fig/out00-PYZ.pyz/fig.packages.docker.client", line 354, in build
  File "/code/build/fig/out00-PYZ.pyz/fig.packages.docker.utils.utils", line 48, in tar
  File "/code/build/fig/out00-PYZ.pyz/tarfile", line 1979, in add
  File "/code/build/fig/out00-PYZ.pyz/tarfile", line 1851, in gettarinfo
OSError: [Errno 2] No such file or directory: 'USERNAME:TOKEN@github.com/user/some-private-repo.git'

docker build https://USERNAME:TOKEN@github.com/user/some-private-repo.git (with the protocol) works fine btw.

@dnephin
Copy link

dnephin commented Sep 1, 2015

This is fixed by #1372 (which is still open)

@dnephin dnephin added this to the 1.5.1 milestone Nov 3, 2015
@dnephin dnephin modified the milestones: 1.6.0, 1.5.1 Nov 11, 2015
@dnephin dnephin modified the milestones: 1.5.2, 1.6.0 Nov 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants