Escaping text from a docker container to Bbedit?

38 views
Skip to first unread message

Marshall Clow

unread,
Feb 27, 2022, 3:18:14 PM2/27/22
to BBEdit Talk
So, I’m playing with Docker on my Mac.
I have some scripts that run in a container and generate text, and I’d like the text to end up in a bbedit window.

Before I dive in and figure out the best way to do this, I thought that I’d ask if anyone has done this before.

If I wasn’t in a docker container, I’d just do:
$ ./script.sh | bbedit —new-window —clean

— Marshall

Scott Lopez

unread,
Feb 27, 2022, 5:49:55 PM2/27/22
to bbe...@googlegroups.com
The whole point of docker is to keep containers isolated from the host.

The easiest option would be to save the text to the docker file system then go back on the Mac side, navigate to the storage folder and open it from there. Cheating horribly, but it will work. There is no way to call out to BBEdit from inside the container, would break the security of containers.

> On Feb 27, 2022, at 2:18 PM, Marshall Clow <mtc...@gmail.com> wrote:
>
> So, I’m playing with Docker on my Mac.
> --
> This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
> ---
> You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/7EBF786C-8778-490F-83DF-0CA0AF188716%40gmail.com.

Marshall Clow

unread,
Feb 27, 2022, 6:29:59 PM2/27/22
to bbe...@googlegroups.com
On Feb 27, 2022, at 12:58 PM, Scott Lopez <sco...@gmail.com> wrote:
>
> The whole point of docker is to keep containers isolated from the host.

Then why do people run web servers inside of containers? ;-)
Obviously there’s a way to communicate outside of the container.

> The easiest option would be to save the text to the docker file system then go back on the Mac side, navigate to the storage folder and open it from there. Cheating horribly, but it will work. There is no way to call out to BBEdit from inside the container, would break the security of containers.

It seems like the same technique that people have used for invoking BBedit remotely (over ssh, or whatever) would work here; but I was asking if anyone had already done it before I dive into it.


>
>> On Feb 27, 2022, at 2:18 PM, Marshall Clow <mtc...@gmail.com> wrote:
>>
>> So, I’m playing with Docker on my Mac.
>> I have some scripts that run in a container and generate text, and I’d like the text to end up in a bbedit window.
>>
>> Before I dive in and figure out the best way to do this, I thought that I’d ask if anyone has done this before.
>>
>> If I wasn’t in a docker container, I’d just do:
>> $ ./script.sh | bbedit —new-window —clean
>>
>> — Marshall
>>
>> --
>> This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
>> ---
>> You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/7EBF786C-8778-490F-83DF-0CA0AF188716%40gmail.com.
>
> --
> This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
> ---
> You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/CACACE96-D8DA-4993-A189-A1E9BB934D6E%40gmail.com.

Sam Birch

unread,
Feb 27, 2022, 7:10:56 PM2/27/22
to BBEdit Talk

Something to the effect of docker run [options] <image> ./script.sh | bbedit --new-window --clean should work.

Or if the container is already running, docker exec <container> ./script.sh | bbedit --new-window --clean.

(You may need to cd to where the script is, or give the full path to the script. If the script is interactive, you may need -it.)

--

This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.

Charlie Garrison

unread,
Feb 27, 2022, 7:11:32 PM2/27/22
to bbe...@googlegroups.com

Good morning,

I agree that containers should be used "as containers", but there are lots of reasons to want to edit files in those containers (or any remote server) - and of course editing with BBEdit is the best. So have a look at rbbedit which allows you to edit within BBEdit from a remote server, including containers. (It does assume SFTP from container to host, but rbbedit supports multiple transfer options, so something other than SFTP may work better with containers.

-cng

--

Charlie Garrison                   <cha...@garrison.com.au>
Garrison Computer Services      <http://www.garrison.com.au>
PO Box 380
Tumbarumba NSW 2653  Australia

Charlie Garrison

unread,
Feb 27, 2022, 7:11:37 PM2/27/22
to bbe...@googlegroups.com

On 28 Feb 2022, at 10:29, Marshall Clow wrote:

It seems like the same technique that people have used for invoking BBedit remotely (over ssh, or whatever) would work here; but I was asking if anyone had already done it before I dive into it.

Yes, it's rbbedit.

-cng

Scott Lopez

unread,
Feb 27, 2022, 9:16:13 PM2/27/22
to bbe...@googlegroups.com
On Sun, Feb 27, 2022 at 5:29 PM Marshall Clow <mtc...@gmail.com> wrote:
On Feb 27, 2022, at 12:58 PM, Scott Lopez <sco...@gmail.com> wrote:
>
> The whole point of docker is to keep containers isolated from the host.

Then why do people run web servers inside of containers? ;-)
Obviously there’s a way to communicate outside of the container.

A web server container can have its content mounted into the container to server, completely different situation.
 
It seems like the same technique that people have used for invoking BBedit remotely (over ssh, or whatever) would work here; but I was asking if anyone had already done it before I dive into it.


That would work, if you are running sshd inside the container.

Reply all
Reply to author
Forward
0 new messages