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

Failed to run docker on Windows #192

Closed
AndreyNikiforov opened this issue Oct 27, 2020 · 2 comments
Closed

Failed to run docker on Windows #192

AndreyNikiforov opened this issue Oct 27, 2020 · 2 comments
Assignees
Labels

Comments

@AndreyNikiforov
Copy link
Collaborator

AndreyNikiforov commented Oct 27, 2020

docker run -it --rm --name icloud_andrey -e TZ=America/Los_Angeles -v m:/photos/andrey:/data -v m:/iCloudCookies:/cookies icloudpd/icloudpd:1.6.2-alpine icloudpd --directory /data --cookie-directory /cookies --username REDACTED --folder-structure {:%Y/%Y-%m-%d} --auto-delete --threads-num 1 --no-progress-bar --until-found 50
Unable to find image 'icloudpd/icloudpd:1.6.2-alpine' locally
1.6.2-alpine: Pulling from icloudpd/icloudpd
Digest: sha256:20ec1dcd7282fdde3160e04bc2313b918e37c568632e3ba772a345bcafa085b5
Status: Downloaded newer image for icloudpd/icloudpd:1.6.2-alpine
2020-10-27 19:39:36 DEBUG    Authenticating...
iCloud Password: 
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/icloudpd/authentication.py", line 29, in authenticate
    icloud = pyicloud_ipd.PyiCloudService(
  File "/usr/lib/python3.8/site-packages/pyicloud_ipd/base.py", line 141, in __init__
    password = get_password_from_keyring(apple_id)
  File "/usr/lib/python3.8/site-packages/pyicloud_ipd/utils.py", line 40, in get_password_from_keyring
    raise NoStoredPasswordAvailable(
pyicloud_ipd.exceptions.NoStoredPasswordAvailable: No pyicloud password for REDACTED could be found in the system keychain.  Use the `--store-in-keyring` command-line option for storing a password for this username.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/icloudpd", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/icloudpd/base.py", line 260, in main
    icloud = authenticate(
  File "/usr/lib/python3.8/site-packages/icloudpd/authentication.py", line 36, in authenticate
    icloud = pyicloud_ipd.PyiCloudService(
  File "/usr/lib/python3.8/site-packages/pyicloud_ipd/base.py", line 193, in __init__
    self.authenticate()
  File "/usr/lib/python3.8/site-packages/pyicloud_ipd/base.py", line 223, in authenticate
    self.session.cookies.save()
  File "/usr/lib/python3.8/http/cookiejar.py", line 1890, in save
    with open(filename, "w") as f:
PermissionError: [Errno 13] Permission denied: '/cookies/REDACTED'

Fat image (Dockerfile in the root) based on python-3.9 works fine (use docker build . -t ddd to build it locally).

Windows 10 2004 plus Docker Desktop:

docker version
Client: Docker Engine - Community
 Cloud integration  0.1.18
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:00:27 2020
 OS/Arch:           windows/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:07:04 2020
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
@AndreyNikiforov
Copy link
Collaborator Author

@boredazfcuk you have some experience with alpine image. Any clue what permission issue may be related to? We use Dockerfile.release for producing public image.

I suspect that using specific USER may have something to do with permissions.

@boredazfcuk
Copy link
Contributor

boredazfcuk commented Oct 27, 2020

In my container, I install a couple of additional Python dependencies: keyrings.alt==1.0 keyring==8.0 to enable keyring functionality. Presumably, these packages exist in the full fat Python based image you use.

I'm guessing why it's generating the NoStoredPasswordAvailable error... because it has no keyring packages and therefore cannot store the password in the keyring file: /home/${user}/.local/share/python_keyring.

In my container, I link the keyring directory to the /config directory where I store the 2FA cookie so that it retains the keyring stored passwords when the container is re-created:

   if [ ! -d "/home/${user}/.local/share/" ]; then mkdir --parents "/home/${user}/.local/share/"; fi
   if [ ! -d "${config_dir}/python_keyring/" ]; then mkdir --parents "${config_dir}/python_keyring/"; fi
   if [ ! -L "/home/${user}/.local/share/python_keyring" ]; then ln --symbolic "${config_dir}/python_keyring/" "/home/${user}/.local/share/"; fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants