-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Error trying to connect to Docker daemon socket when building #442
Comments
If anyone has thoughts on what they would like, I'm happy to try adding error messaging or updating the docs! Or if it's felt this is not useful / not the responsibility of briefcase, totally understand! |
Completely agreed - anything we can do to identify "obvious" sources of error and provide workarounds would be a welcome addition. Docker is mentioned in the AppImage reference docs since that's the only backend that uses Docker. If we can elaborate on these docs, or link to them better, suggestions are welcome. However the ideal outcome is to not need the docs at all (if only because nobody ever reads the the docs unless they absolutely have to :-). Is it possible to perform a runtime check to detect if Docker is runnable without sudo? We have a number of pre-execution checks on various platforms, including a check that Docker is installed and is a sufficient version. If we can put a simple "try this command; if it failed with error code 42, print the error about making a sudo group", check at the start of the Docker commands, then that would be ideal. |
Ah indeed I didn't read those docs ;) Re: runtime check for Docker, yea should be able to. The dumbest thing I can imagine working quickly would be running any docker command ( |
That sounds ideal. One thing to keep in mind is that whatever approach you take, it also needs to work on macOS and Windows, so leaning too hard on Linux socket internals could be problematic. If invoking a "docker info" command gives you an identifiable error code, that would be ideal. While you're in the area - it occurs to me that it might also be a good idea to check whether the docker daemon is actually running at all (ie., I have the right permissions, but the daemon has been stopped). I can imagine that would also be a likely source of error, and equally preventable - probably with the same |
Oh, yes both great points I'm not 100% sure the same class of error does happen on those OS's (they both run docker differently with a VM intermediary, is my limited understanding? At least they don't have the equivalent steps in their install instructions in dockers docs) but point taken about it needing to be cross-platform regardless - adding a check that would just break on the other systems would not be good :). The daemon not running at all is a great check too, I'll mess around with that too. Alright I'll at least sketch out a solution with |
Code now uses a preflight `docker info` command to check the availabilty of docker commands. Tested only on linux Addresses issue beeware#442 Signed-off-by: Danny <danny@cultureiq.com>
Fixed by #443. |
Trying out the basic commands with the empty / default app. When running
briefcase build
, I get:This isn't really an error / fault of briefcase - it's because when I installed docker initially I didn't bother to do the post install step of making a new group so I could call
docker
withoutsudo
(documented here: https://docs.docker.com/engine/install/linux-postinstall/ or the helpful SO answer here: https://stackoverflow.com/questions/21871479/docker-cant-connect-to-docker-daemon ).But it is relatively common (judging by personal experience + number of similar stack overflow posts), maybe the error message could include a mention / link to that? Or the briefcase docs? Or mention the
--no-docker
flag? [The building docs here (https://docs.beeware.org/en/latest/tutorial/tutorial-3.html#building-your-application) mention that docker is used to build but it's relatively sparse - I only noticed the --no-docker flag grepping around in the source to see if I could hack in adding asudo
to the front of the docker commands just to get it to work]The text was updated successfully, but these errors were encountered: