-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support building with Dockerfile outside of context #1977
Conversation
Signed-off-by: Joffrey F <joffrey@docker.com>
Signed-off-by: Joffrey F <joffrey@docker.com>
5c6d557
to
cdbbb06
Compare
docker/utils/utils.py
Outdated
if not fileobj: | ||
fileobj = tempfile.NamedTemporaryFile() | ||
t = tarfile.open(mode='w:gz' if gzip else 'w', fileobj=fileobj) | ||
if files is None: | ||
files = build_file_list(root) | ||
for path in files: | ||
if path in [e[0] for e in extra_files]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking, but any(e[0] == path for e in extra_files)
won't build the whole list in memory. Maybe even building a set(e[0] for e in extra_files)
before to avoid iterating too many times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit on extra_files
, but LGTM anyway.
Signed-off-by: Joffrey F <joffrey@docker.com>
Thank you for reviewing! 👍 |
Thanks @shin- ! (Not enough experience with python though to review 😅) |
Based on docker/cli#886
Fixes docker/compose#5823