Re: [code] Unable to run Textadept on Docker container

From: Emil Axelsson <78emil.att.gmail.com>
Date: Sat, 27 May 2017 10:46:44 +0200

Hi!

Just wanted to post a quick follow-up. Strangely, when I tried the exact
same thing today it all worked. My only guess is that this was a bug in
Docker itself that has been fixed, because nothing else can have changed.

Sometimes waiting a few weeks is a good strategy :)

Cheers

/ Emil

Den 2017-05-12 kl. 18:13, skrev Emil Axelsson:
> Den 2017-05-12 kl. 05:01, skrev Mitchell:
>> Hi Emil,
>>
>> On Thu, 11 May 2017, Emil Axelsson wrote:
>>
>>> Hi Mitchell
>>>
>>> Den 2017-05-11 kl. 02:09, skrev Mitchell:
>>>> Hi Emil,
>>>>
>>>> On Wed, 10 May 2017, Emil Axelsson wrote:
>>>>
>>>>> Den 2017-05-10 kl. 22:18, skrev Mitchell:
>>>>>> Hi Emil,
>>>>>>
>>>>>> On Wed, 10 May 2017, Emil Axelsson wrote:
>>>>>>
>>>>>>> Den 2017-05-10 kl. 15:28, skrev Mitchell:
>>>>>>>> Hi Emil,
>>>>>>>>
>>>>>>>> On Wed, 10 May 2017, Emil Axelsson wrote:
>>>>>>>>
>>>>>>>>> Den 2017-05-10 kl. 04:10, skrev Mitchell:
>>>>>>>>>> Hi Emil,
>>>>>>>>>>
>>>>>>>>>> On Tue, 9 May 2017, Emil Axelsson wrote:
>>>>>>>>>>
>>>>>>>>>>> [Trying again without +help in the address.]
>>>>>>>>>>>
>>>>>>>>>>> Hi!
>>>>>>>>>>>
>>>>>>>>>>> I'd like to use Textadept on an Ubuntu Docker container, but it
>>>>>>>>>>> doesn't work.
>>>>>>>>>>>
>>>>>>>>>>> I start with a clean container:
>>>>>>>>>>>
>>>>>>>>>>> sudo docker run -it --rm ubuntu
>>>>>>>>>>>
>>>>>>>>>>> Inside the container I run the following commands:
>>>>>>>>>>>
>>>>>>>>>>> apt-get update
>>>>>>>>>>> apt-get install -y wget
>>>>>>>>>>> wget
>>>>>>>>>>> https://foicica.com/textadept/download/textadept_LATEST.x86_64.tgz
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> tar zxvf textadept_LATEST.x86_64.tgz
>>>>>>>>>>>
>>>>>>>>>>> Then when I try to run `textadept_9.4.x86_64/textadept-curses`,
>>>>>>>>>>> I get
>>>>>>>>>>> a blank terminal. If I press enter I get this message:
>>>>>>>>>>>
>>>>>>>>>>> [Message Buffer] - Textadept ([Message Buffer])attempt to index
>>>>>>>>>>> a nil
>>>>>>>>>>> value
>>>>>>>>>>> /textadept_9.4.x86_64/themes/term.lua:76: attempt to index a nil
>>>>>>>>>>> value
>>>>>>>>>>> (field 'run')
>>>>>>>>>>>
>>>>>>>>>>> But it's working to some extent: I can move around and type in
>>>>>>>>>>> the
>>>>>>>>>>> message buffer.
>>>>>>>>>>>
>>>>>>>>>>> Any idea what went wrong?
>>>>>>>>>>
>>>>>>>>>> Textadept uses `/proc/self/exe` to determine its location and
>>>>>>>>>> thus the
>>>>>>>>>> location of its `modules/` directory, which contains the
>>>>>>>>>> `textadept.run`
>>>>>>>>>> module among others.
>>>>>>>>>>
>>>>>>>>>> I would venture a guess that docker does not supply a similar
>>>>>>>>>> mechanism,
>>>>>>>>>> so Textadept has no idea where it is. I did not account for
>>>>>>>>>> this, so
>>>>>>>>>> there is no workaround. Sorry :(
>>>>>>>>>
>>>>>>>>> Hm.. It seems that `/proc/self/exe` is working fine. Here is
>>>>>>>>> what I
>>>>>>>>> get from inside the container:
>>>>>>>>>
>>>>>>>>> # ls -l proc/self/exe
>>>>>>>>> lrwxrwxrwx 1 root root 0 May 10 07:36 proc/self/exe -> /bin/ls
>>>>>>>>>
>>>>>>>>> Any other ideas?
>>>>>>>>
>>>>>>>> In your ~/.textadept/init.lua add:
>>>>>>>>
>>>>>>>> local f = io.open('/tmp/foo', 'w')
>>>>>>>> f:write(_HOME)
>>>>>>>> f:close()
>>>>>>>>
>>>>>>>> The contents of /tmp/foo should be the directory of
>>>>>>>> textadept-curses,
>>>>>>>> and that directory should also contain Textadept's core files and
>>>>>>>> folders (including "modules/").
>>>>>>>
>>>>>>> Just so I'm not misunderstanding, are you saying /tmp/foo should
>>>>>>> be a
>>>>>>> text file with one line giving the path to the unpacked Textadept
>>>>>>> tarball? Or that /tmp/foo should be that directory?
>>>>>>
>>>>>> /tmp/foo should be a text file whose contents are Textadept's "home"
>>>>>> directory.
>>>>>
>>>>> OK, yeah, that didn't work.
>>>>>
>>>>>>> I'm afraid neither option helps though -- same result.
>>>>>>
>>>>>> Hmm, so Textadept has no idea where it is. The application
>>>>>> attempts to
>>>>>> read from "/proc/self/exe" (note the leading '/'). Perhaps that is
>>>>>> causing the problem. I noticed in your "ls" example, you read from
>>>>>> "proc/self/exe".
>>>>>
>>>>> Sorry, that was a confusing example. I ran `ls -l proc/self/exe` from
>>>>> the root directory, so I omitted the leading /.
>>>>
>>>> Might you be running into the issue here?
>>>> https://github.com/moby/moby/issues/18883
>>>
>>> No, not able to reproduce that error.
>>>
>>> Any idea if this could be related?
>>>
>>> https://github.com/moby/moby/issues/11462
>>>
>>> I can reproduce it, and a fix was merged only three days ago. But it's
>>> really just a blind guess. I'm new to Docker, and I don't know if/when
>>> fixes in Moby end up in the official Ubuntu image.
>>
>> No, that doesn't look related :(
>>
>>> Unless you have any other ideas, I'll put this on hold for a while and
>>> see if I'll have better luck next time.
>>
>> I'm out of ideas. I'm not familiar at all with Docker. Sorry.
>
> Thanks for your help anyway!
>
> Cheers
>
> / Emil

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sat 27 May 2017 - 04:46:44 EDT

This archive was generated by hypermail 2.2.0 : Sat 27 May 2017 - 06:31:59 EDT