You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Nick Dunkin <Ni...@vecima.com> on 2022/01/04 19:41:30 UTC

Building Traffic Server - static linking

Hi

We are wanting to deploy Traffic Server in a Docker container, and would like to achieve the smallest possible container size.

Is it possible to build Traffic Server with static linking, so that we can run a single executable in a distroless container?

Thanks

Nick

Nick Dunkin
Director, Software Engineering
Manager – Architecture and New Product Introduction
o:  +1 678.258.4071
e: nick.dunkin@vecima.com<ma...@vecima.com>

[cidimage001.png@01D6CC8C.6FC5A580]


Re: Building Traffic Server - static linking

Posted by Leif Hedstrom <zw...@apache.org>.

> On Jan 5, 2022, at 8:57 AM, Nick Dunkin <Ni...@vecima.com> wrote:
> 
> Hi Leif,
>  
> Thanks for the response.  This is certainly something that we would be interested in pursuing and contributing if successful.
>  
> One thing I don’t understand.  How would the plugins work in this scenario (the .so files)?  Would we need to statically link the set of plugins we’d want available in the final traffic_server executable?  Or would plugins simply not be supported in this model?

Yeh, plugins would be tricky, maybe impossible. That would certainly require code changes to the core at a minimum. You would essentially have to tell it which plugins to build into the traffic_server binary, and bypass all the dlopen() dynamic loading of modules. Definitely tricky :).

— Leif

>  
> Thanks
>  
> Nick 
>  
> From: Leif Hedstrom <zw...@apache.org>
> Date: Tuesday, January 4, 2022 at 6:02 PM
> To: Users <us...@trafficserver.apache.org>, Nick Dunkin <Ni...@vecima.com>
> Subject: Re: Building Traffic Server - static linking
> 
>  
> 
> 
> On Jan 4, 2022, at 12:41 PM, Nick Dunkin <Nick.Dunkin@vecima.com <ma...@vecima.com>> wrote:
>  
> Hi
>  
> We are wanting to deploy Traffic Server in a Docker container, and would like to achieve the smallest possible container size.
>  
> Is it possible to build Traffic Server with static linking, so that we can run a single executable in a distroless container?
>  
> That “option” was removed quite a while ago unfortunately. If someone is interested in making it viable again, we’d certainly take a PR. This should (in theory) not require any code changes, rather, just changes to (optionally) control static builds via configure.ac and the various Makefile.am’s.
>  
> Cheers,
>  
> — Leif


Re: Building Traffic Server - static linking

Posted by Nick Dunkin <Ni...@vecima.com>.
Hi Leif,

Thanks for the response.  This is certainly something that we would be interested in pursuing and contributing if successful.

One thing I don’t understand.  How would the plugins work in this scenario (the .so files)?  Would we need to statically link the set of plugins we’d want available in the final traffic_server executable?  Or would plugins simply not be supported in this model?

Thanks

Nick

From: Leif Hedstrom <zw...@apache.org>
Date: Tuesday, January 4, 2022 at 6:02 PM
To: Users <us...@trafficserver.apache.org>, Nick Dunkin <Ni...@vecima.com>
Subject: Re: Building Traffic Server - static linking



On Jan 4, 2022, at 12:41 PM, Nick Dunkin <Ni...@vecima.com>> wrote:

Hi

We are wanting to deploy Traffic Server in a Docker container, and would like to achieve the smallest possible container size.

Is it possible to build Traffic Server with static linking, so that we can run a single executable in a distroless container?

That “option” was removed quite a while ago unfortunately. If someone is interested in making it viable again, we’d certainly take a PR. This should (in theory) not require any code changes, rather, just changes to (optionally) control static builds via configure.ac and the various Makefile.am’s.

Cheers,

— Leif



Re: Building Traffic Server - static linking

Posted by Leif Hedstrom <zw...@apache.org>.

> On Jan 4, 2022, at 12:41 PM, Nick Dunkin <Ni...@vecima.com> wrote:
> 
> Hi
>  
> We are wanting to deploy Traffic Server in a Docker container, and would like to achieve the smallest possible container size.
>  
> Is it possible to build Traffic Server with static linking, so that we can run a single executable in a distroless container?

That “option” was removed quite a while ago unfortunately. If someone is interested in making it viable again, we’d certainly take a PR. This should (in theory) not require any code changes, rather, just changes to (optionally) control static builds via configure.ac and the various Makefile.am’s.

Cheers,

— Leif