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

Incorrect behavior for remove_ignored_files #545

Open
sumdog opened this issue Jan 21, 2019 · 0 comments
Open

Incorrect behavior for remove_ignored_files #545

sumdog opened this issue Jan 21, 2019 · 0 comments

Comments

@sumdog
Copy link

sumdog commented Jan 21, 2019

I had an issue trying to build a project called pixelfed:

require 'git'
require 'docker'
git = Git.clone('https://github.com/pixelfed/pixelfed', '.', :path => '/tmp/pxf')
git.checkout('v0.7.6')
Docker::Image.build_from_dir('/tmp/pxf')

This gave me the following:

Docker::Error::ServerError (Cannot locate specified Dockerfile: Dockerfile)

However doing this manually on the command line works fine:

git clone https://github.com/pixelfed/pixelfed
git checkout v0.7.6
docker build . -t pixelfed

At first I thought it was due to Dockerfile being a symbolic link, but after some debugging, it turns out in pixelfed, they keep their Dockerfiles in .dockerignore for some reason. This is probably not correct on their part, but I find it interesting the CLI tool still transmits everything in .dockerignore to the daemon itself (and the daemon then ignores those files in building/copying).

I found the issue where this support was added: #313

I can see the advantage of doing this before sending the data to the Docker daemon, but this behavior doesn't match the docker CLI and should probably have a configuration setting to enable it or disable it.

I'm not sure what the best/correct solution is, but if anyone else encounters this, here's a quick and dirty monkey patch:

require ' docker'

module Docker::Util
  def self.remove_ignored_files!(directory, files)
    # Remove this function as it breaks compatiablity
    # with the docker CLI; discovered with Pixelfed
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant