-
Notifications
You must be signed in to change notification settings - Fork 837
Enable docker build by only cloning the repository #604
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
Open
Checker8763
wants to merge
2
commits into
novnc:master
Choose a base branch
from
Checker8763:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What are we losing in this switch? We have a bunch of optional dependencies, like numpy, that users probably want.
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.
There is essentially nothing lost, only gained.
With the slim version the final image size reduced by only having the necessary runtime requirenments for python.
With specifying version 3 the builds are more explicit which helps anybody reading the Dockerfile, and making the build more predictable by actually being explicit to the dependend python version (Imagine python 4 is released and the dockerfile simply states python with an implicit latest).
By using the slim version there is less traffic ~1.2GB vs ~200MB and less stored.
Also by splitting the build into two stages the size is also reduced by only copying the necessary files to the final image, leaving any cache, temporary files etc. behind.
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.
Forgott that there is nothing lost, the full requirenments are installed.
Only the base Image i think Debian or Ubuntu, is not installed in a full fledged way but in a minimal with python runtime.
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.
Okay, it seems like the Python side are indeed the same.
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.
When I run the build in the "specific_package" branch in the git root with the command
docker build -t websockify -f docker/Dockerfile .I get this error:
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.
It seems to be tied to the environment, if I wrap the statements in a shell script and execute them with bash it works just fine, but when executed as a plain command in the docker file in a RUN statement it somehow breaks...
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.
I have debugged a bit further and found that
find_packages()resolves to[]When I hardcode
packages=[]it builds just fine.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.
I have found the following section in the python docs:
~ https://docs.python.org/3.11/distutils/setupscript.html#listing-whole-packages
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.
While reading in https://setuptools.pypa.io/en/latest/userguide/package_discovery.html
Another workaround I have found was to include
package_dir = {"websockify": ""},orpackage_dir = {"websockify": "."},orpackage_dir = {"websockify": "/"},This seems to be the least required amount of changes, to make the dockerfile work while leaving the statements in the dockerfile unchanged.
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.
I'm afraid I cannot reproduce the issue here. And it really should work. The documentation you refer to states:
And since we say
packages=['websockify'], we claim that there is awebsockifydirectory next tosetup.py. Which there is.It seems like there is something more in your environment that is fouling thing.