Termux-packages: Udocker installs in Termux!

Created on 20 Aug 2018  路  11Comments  路  Source: termux/termux-packages

Udocker is a "basic user tool to execute simple docker containers in user space without requiring root privileges". This "Enables download and execution of docker containers by non-privileged users in Linux systems where docker is unavailable".

[13:16 indigo-dc ]$ git clone https://github.com/indigo-dc/udocker
Cloning into 'udocker'...
remote: Counting objects: 1789, done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 1789 (delta 25), reused 25 (delta 11), pack-reused 1747
Receiving objects: 100% (1789/1789), 1.90 MiB | 10.00 KiB/s, done.
Resolving deltas: 100% (1063/1063), done.
[13:19 indigo-dc ]$ cd udocker/
[13:20 udocker ]$  ./udocker.py install
Traceback (most recent call last):
  File "./udocker.py", line 6663, in <module>
    sys.exit(Main().start())
  File "./udocker.py", line 6596, in __init__
    self.udocker = Udocker(self.localrepo)
  File "./udocker.py", line 5505, in __init__
    self.dockerioapi = DockerIoAPI(localrepo)
  File "./udocker.py", line 4662, in __init__
    self.curl = GetURL()
  File "./udocker.py", line 4377, in __init__
    self._select_implementation()
  File "./udocker.py", line 4385, in _select_implementation
    elif GetURLexeCurl().is_available():
  File "./udocker.py", line 4545, in is_available
    return bool(FileUtil("curl").find_exec())
  File "./udocker.py", line 929, in find_exec
    cmd = self._find_exec("which " + self.basename)
  File "./udocker.py", line 921, in _find_exec
    if "not found" in exec_pathname:
TypeError: a bytes-like object is required, not 'str'
[13:23 udocker ]$ 

https://github.com/indigo-dc/udocker/issues/152
https://www.tchpc.tcd.ie/node/1312

Most helpful comment

It does sort of install but there are no available tarballs for ARM and thus it doesn't fully install.

All 11 comments

The result is similar, but not identical with Arch Linux in Termux PRoot:

[13:56 home ]$ cd git/indigo-dc/udocker/
[13:57 udocker ]$ ./udocker.py install
Traceback (most recent call last):                                                          File "./udocker.py", line 6663, in <module>
    sys.exit(Main().start())
  File "./udocker.py", line 6596, in __init__                                                 self.udocker = Udocker(self.localrepo)
  File "./udocker.py", line 5505, in __init__                                                 self.dockerioapi = DockerIoAPI(localrepo)
  File "./udocker.py", line 4662, in __init__
    self.curl = GetURL()                                                                    File "./udocker.py", line 4377, in __init__
    self._select_implementation()
  File "./udocker.py", line 4385, in _select_implementation                                   elif GetURLexeCurl().is_available():
  File "./udocker.py", line 4545, in is_available
    return bool(FileUtil("curl").find_exec())                                               File "./udocker.py", line 929, in find_exec                                                 cmd = self._find_exec("which " + self.basename)
  File "./udocker.py", line 921, in _find_exec
    if "not found" in exec_pathname:
TypeError: a bytes-like object is required, not 'str'
[13:57 udocker ]$

udocker.py doesn't seem to accept a "install" argument.
Try installing it as other python projects, with python setup.py install.

@Grimler91 Thank you. Installs, but does not work as expected in Termux and Termux PRoot. Any idea why?

[15:45 udocker ]$ python setup.py install
running install
running build
running build_scripts
creating build/scripts-3.7
copying and adjusting udocker -> build/scripts-3.7
changing mode of build/scripts-3.7/udocker from 644 to 755
running install_scripts
copying build/scripts-3.7/udocker -> /usr/bin
changing mode of /usr/bin/udocker to 755
running install_egg_info
Writing /usr/lib/python3.7/site-packages/udocker-1.1.1-py3.7.egg-info
[15:45 udocker ]$ udocker help
Traceback (most recent call last):
  File "/usr/bin/udocker", line 6663, in <module>
    sys.exit(Main().start())
  File "/usr/bin/udocker", line 6596, in __init__
    self.udocker = Udocker(self.localrepo)
  File "/usr/bin/udocker", line 5505, in __init__
    self.dockerioapi = DockerIoAPI(localrepo)
  File "/usr/bin/udocker", line 4662, in __init__
    self.curl = GetURL()
  File "/usr/bin/udocker", line 4377, in __init__
    self._select_implementation()
  File "/usr/bin/udocker", line 4385, in _select_implementation
    elif GetURLexeCurl().is_available():
  File "/usr/bin/udocker", line 4545, in is_available
    return bool(FileUtil("curl").find_exec())
  File "/usr/bin/udocker", line 929, in find_exec
    cmd = self._find_exec("which " + self.basename)
  File "/usr/bin/udocker", line 921, in _find_exec
    if "not found" in exec_pathname:
TypeError: a bytes-like object is required, not 'str'
[15:45 udocker ]$ udocker
Error: parsing command line, use: udocker help
[15:45 udocker ]$

Try with python2 perhaps. Seems like a rather trivial error in udocker.
Your upstream issue hopefully get some attention so that it is fixed.

The result is much better with Python 2:

[16:09 udocker ]$ udocker help
Info: installing 1.1.1
Info: installing from: https://owncloud.indigo-datacloud.eu/index.php/s/AFImjw8ii0X72xf/download
Error: in download:
Info: installing from: http://repo.indigo-datacloud.eu/repository/indigo/2/centos7/x86_64/tgz/udocker-1.1.1.tar.gz
Error: in download:
Info: installing from: https://cernbox.cern.ch/index.php/s/VC7GuVWA7mYRAiy/download
Error: in download:
Error: installing tarball: https://owncloud.indigo-datacloud.eu/index.php/s/AFImjw8ii0X72xf/download https://cernbox.cern.ch/index.php/s/VC7GuVWA7mYRAiy/download http://repo.indigo-datacloud.eu/repository/indigo/2/centos7/x86_64/tgz/udocker-1.1.1.tar.gz

        Udocker installation instructions are available at:

          https://indigo-dc.gitbooks.io/udocker/content/

        Udocker requires additional tools to run. These are available
        in the tarball that comprises udocker. The tarballs are available
        at the INDIGO-DataCloud repository under tarballs at:

Thank you for the thorough instructions in this issue @Grimler91.

Udocker appears to suffer from the same affliction as gradle, and some others do too: exclusive x86 dependency; Do you agree?

The result is much better with Python 2:

python2 setup.py install

It is Python 2 only:
https://github.com/indigo-dc/udocker/issues/131

@sdrausty Were you able to successfully run the command above and install the udocker tools?

It does sort of install but there are no available tarballs for ARM and thus it doesn't fully install.

thus it doesn't fully install

@davemackintosh it does now. It is udocker btw:

udocker is a basic user tool to execute simple docker containers in user space without requiring root privileges

The commands pacman -S python2-pip && pip2 install setuptools have got udocker running on Android 10 in Arch Linux in Termux PRoot:

[user15:55udocker]$ udocker pull cfmanteiga/alpine-bash-curl-jq           
Downloading layer: sha256:fe2a0d033fc4104cf66bed5e778d032a5d582c10c4683f1bac9b0d43f4c380ef                                                    
Downloading layer: sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4                                                    
Downloading layer: sha256:e61ca54ed02c6c26cf7adfdc655cd6ecb61dd63137899968404d22f49296364d                                                    
Downloading layer: sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4                                                    
[user15:55udocker]$ udocker images                                        
REPOSITORY                                                             
cfmanteiga/alpine-bash-curl-jq:latest
[user15:56udocker]$

Do you know the next command and a good simple primer about docker?

I gave up on this a long time ago. I use ngrok to tunnel a sub domain of my site to a latte panda in my office and just use docker-compose. If you want to learn about Docker check YouTube and the documentation.

Were you able to successfully run the command above and install the udocker tools?

@estebond yes, the commands finally ran successfully. How do you install the udocker tools?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

newmania picture newmania  路  3Comments

zejji picture zejji  路  4Comments

thurask picture thurask  路  3Comments

tigran123 picture tigran123  路  3Comments

roycebank picture roycebank  路  3Comments