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

Inform User Docker Desktop on Linux is not Supported #1082

Closed
rmartin16 opened this issue Feb 5, 2023 · 3 comments
Closed

Inform User Docker Desktop on Linux is not Supported #1082

rmartin16 opened this issue Feb 5, 2023 · 3 comments
Labels
bug A crash or error in behavior. good first issue Is this your first time contributing? This could be a good place to start! linux The issue relates Linux support.

Comments

@rmartin16
Copy link
Member

rmartin16 commented Feb 5, 2023

Describe the bug

When creating an AppImage with Docker Desktop installed, Briefcase will encounter errors setting up the build environment. Users are likely to first encounter an error when installing the pip requirements.

Docker Desktop uses a VM to run containers and this complicates bind mounts a bit since ensuring the brutus user has the same uid/gid of the host user is not enough for transparent file sharing. Docker has recommendations for attempting to handle this.

In the example below, the bind mount for /home/russell/tmp/beeware/helloworld/linux:/app:z results in /app being owned by root:root. You can run chown /app to the brutus user but then the underlying linux directory becomes owned by a nonexistent user on the host...

Error and Stacktrace
[helloworld] Entering Docker context...
WARNING: The directory '/home/brutus/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Collecting toga-gtk>=0.3.0.dev38
  Downloading toga_gtk-0.3.0-py3-none-any.whl (50 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.6/50.6 kB 3.5 MB/s eta 0:00:00
Collecting gbulb>=0.5.3
  Downloading gbulb-0.6.3-py2.py3-none-any.whl (17 kB)
Collecting pygobject>=3.14.0
  Downloading PyGObject-3.42.2.tar.gz (719 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 719.5/719.5 kB 18.3 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting pycairo>=1.17.0
  Downloading pycairo-1.23.0.tar.gz (344 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 344.6/344.6 kB 72.8 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting toga-core==0.3.0
  Downloading toga_core-0.3.0-py3-none-any.whl (499 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 499.1/499.1 kB 52.5 MB/s eta 0:00:00
Collecting travertino>=0.1.3
  Downloading travertino-0.1.3-py3-none-any.whl (15 kB)
Building wheels for collected packages: pycairo, pygobject
  Building wheel for pycairo (pyproject.toml): started
  Building wheel for pycairo (pyproject.toml): finished with status 'done'
  Created wheel for pycairo: filename=pycairo-1.23.0-cp310-cp310-linux_x86_64.whl size=300291 sha256=61a3519ed0f982f267986dbc1330b5f780bae3f8ea39266ace98fa41922d2a42
  Stored in directory: /tmp/pip-ephem-wheel-cache-8ohv1zle/wheels/5c/c3/fe/96c2478f6a186da0f6331ed82da38414b91df3d7b51fcc0919
  Building wheel for pygobject (pyproject.toml): started
  Building wheel for pygobject (pyproject.toml): finished with status 'done'
  Created wheel for pygobject: filename=PyGObject-3.42.2-cp310-cp310-linux_x86_64.whl size=785543 sha256=e98de99059113384dc4e3783c1f118d41cac8a18a96e3d64a10e56ecd6a45c5f
  Stored in directory: /tmp/pip-ephem-wheel-cache-8ohv1zle/wheels/60/a9/e2/e27748fff4cc318a8b24ca92dbe7b80ba1f02a47f623311e51
Successfully built pycairo pygobject
Installing collected packages: travertino, pycairo, toga-core, pygobject, gbulb, toga-gtk
Successfully installed gbulb-0.6.3 pycairo-1.23.0 pygobject-3.42.2 toga-core-0.3.0 toga-gtk-0.3.0 travertino-0.1.3
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.10/shutil.py", line 816, in move
    os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: '/tmp/pip-target-aj4lxokp/lib/python/gi' -> '/app/appimage/Hello World/Hello World.AppDir/usr/app_packages/gi'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/brutus/.local/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 160, in exc_logging_wrapper
    status = run_func(*args)
  File "/home/brutus/.local/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 247, in wrapper
    return func(self, options, args)
  File "/home/brutus/.local/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 553, in run
    self._handle_target_dir(
  File "/home/brutus/.local/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 612, in _handle_target_dir
    shutil.move(os.path.join(lib_dir, item), target_item_dir)
  File "/usr/lib/python3.10/shutil.py", line 832, in move
    copytree(src, real_dst, copy_function=copy_function,
  File "/usr/lib/python3.10/shutil.py", line 559, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
  File "/usr/lib/python3.10/shutil.py", line 457, in _copytree
    os.makedirs(dst, exist_ok=dirs_exist_ok)
  File "/usr/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/app/appimage/Hello World/Hello World.AppDir/usr/app_packages/gi'

[notice] A new release of pip available: 22.3.1 -> 23.0
[notice] To update, run: python3.10 -m pip install --upgrade pip
Installing app requirements...

Unable to install requirements. This may be because one of your
requirements is invalid, or because pip was unable to connect
to the PyPI server.

Log saved to /home/russell/tmp/beeware/helloworld/logs/briefcase.2023_02_05-11_37_05.create.log

Steps to reproduce

  1. Install Docker Desktop
  2. Ensure the context shown from docker info is desktop-linux
  3. Run briefcase create

Expected behavior

Briefcase should inform users that Docker Desktop is not supported during Docker verification.

Screenshots

No response

Environment

  • Operating System: pop os 22.04
  • Python version: 3.10.9
  • Software versions:
    • Briefcase: 0.3.13.dev24+gbc68cf4

Logs

briefcase.2023_02_05-11_37_05.create.log

Additional context

No response

@rmartin16 rmartin16 added the bug A crash or error in behavior. label Feb 5, 2023
@rmartin16 rmartin16 added the linux The issue relates Linux support. label Feb 5, 2023
@freakboy3742
Copy link
Member

+1 to this as a reasonable workaround; however, we need to make sure this validation path is Linux specific, as macOS uses Docker Desktop and isn't affected by this problem.

Documentation also needs to be updated (both for Briefcase, and the BeeWare tutorial) to highlight the problem.

@freakboy3742 freakboy3742 added the good first issue Is this your first time contributing? This could be a good place to start! label Apr 15, 2023
@rmartin16
Copy link
Member Author

This should be pretty straight forward to detect. If adding support for Docker Desktop stalls or we get close to the next release...I may just implement this error for the time being.

When Docker Desktop is being used:

docker version
Client: Docker Engine - Community
 Cloud integration: v1.0.33
 Version:           24.0.2
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        cb74dfc
 Built:             Thu May 25 21:51:00 2023
 OS/Arch:           linux/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.20.0 (109717)
 Engine:
  Version:          24.0.2
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.4
  Git commit:       659604f
  Built:            Thu May 25 21:52:17 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

When Docker Engine is being used:

docker version
Client: Docker Engine - Community
 Cloud integration: v1.0.33
 Version:           24.0.2
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        cb74dfc
 Built:             Thu May 25 21:51:00 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.2
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.4
  Git commit:       659604f
  Built:            Thu May 25 21:51:00 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad

@rmartin16
Copy link
Member Author

@rmartin16 rmartin16 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. good first issue Is this your first time contributing? This could be a good place to start! linux The issue relates Linux support.
Projects
None yet
Development

No branches or pull requests

2 participants