<div dir="ltr">Absolutely! You would do that with an ENV (environment variable) setting in the Dockerfile. Once that was setup, you can override that at build time (basically you set a "default" value, and then you can override it from the docker build command when you're building the container image).<div><br></div><div>So phase 1 is actually already dead. I've been busy working on a provisioning platform the last two weeks (on top of being sick), but I'm through enough of it that I should be able to get to my phase 2 blog post this week (ideally this afternoon).</div><div><br></div><div>The preferred approach (as mentioned in my phase 1 blog post) is to actually base on an RPM package. One of the issues was just trying to deal with fedpkg (which is an awesome system btw) and getting custom changes, and whatever version of Asterisk you wanted.</div><div><br></div><div>I've solved this with FPM and a companion container. More in the blog post, but basically the essence is that you run a docker build command in your local Asterisk source directory, it compiles it and packages it into an RPM that is stored back on your local host. Then you run one more docker build command to install that RPM into your Asterisk container image, and the result is your own custom Asterisk container image with your local mods (or custom menuselect flags, etc).</div><div><br></div><div>It's pretty slick actually, and solves a lot of the problems I was having with my original approach. Thanks to Alan Graham who pointed out an excellent Git repo that builds the RPMs using FPM with minimal effort.</div><div><br></div><div>Thanks!</div><div>Leif.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 24, 2015 at 5:26 PM, Corey Farrell <span dir="ltr"><<a href="mailto:git@cfware.com" target="_blank">git@cfware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Leif,</div><div><br></div><div>Thanks for explaining I should have read your blog post before replying to Jared's email about the RPM's. I didn't realize EPEL was that strict with version freezes to stay with a no longer supported version.</div><div><br></div><div>I do not know too much about Docker yet but I took a look anyways. Can variables be used in Dockerfile.asterisk? The idea is to be able to use a new version of Asterisk without having to update the version on 40 lines. Also when someone forks your GIT repo to add/remove packages from the install list, they won't face 'git rebase' conflicts after you update the version.</div><div><br></div><div>Thanks,</div><div>Corey</div><div class="HOEnZb"><div class="h5"><div><div><br></div><div>On Thursday, November 19, 2015, Leif Madsen <<a>leif.madsen@avoxi.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey Corey!<div><br></div><div>The way it works is that major versions of Asterisk (and same with other packages) are associated with specific releases of Fedora and RHEL, which means the major versions are "stuck" to those releases.</div><div><br></div><div>However, you can still build the newer version of Asterisk by pulling the spec file and sources from later Fedora versions (Fedora 23 for instance).</div><div><br></div><div>You can rebuild the RPMs supplied using fedpkg, as I've done in phase 1 of my blog post. There are other ways you can do it was well, like with mock etc.</div><div><br></div><div>(You'll need some dependencies in order to build everything).</div><div><br></div><div>If you look at my buildit.sh script, it provides the primitives for building the dependencies. I'm doing this via a local build with rpmbuild (because the script is run in the Docker container), but you could also replace this with a fedpkg mock build which would build the RPMs in the chroot for you. There might be some things that are slightly more complicated in that method, because you'd have to get the resulting dependency RPMs into the chroot (possible, it's just not super straight forward if you haven't done it before).</div><div><br></div><div>I'd probably still suggest doing it in the Docker container, simply because it's super simple to get things spun up. You can even use the local.repo file I'm providing as well. Basically everything you need to build Asterisk for your platform (Red Hat based) is in the repo linked above.</div><div><br></div><div>Note: this won't work on CentOS 6. There are some oddities with CentOS 6 in Docker that resulted in me not being able to build Asterisk in the CentOS 6 container (gcc complained about not being able to result in a binary or something).</div><div><br></div><div>Long story short, use fedpkg to build the RPMs from the Fedora repositories. Just clone the Fedora 23 version (which gets you Asterisk 13.3.2 as of now), and then build it on top of the system you want (CentOS 6 or 7 for example).</div><div><br></div><div>Thanks!</div><div>Leif.<br><br>On Thu, Nov 19, 2015 at 2:23 PM, Corey Farrell <<a>git@cfware.com</a>> wrote:<br>><br>> Jared,<br>><br>> I just looked through the EPEL website at EPEL6 and EPEL7, only found<br>> Asterisk 1.8. Can you point me to the spec file you are using or an<br>> SRPM?<br>><br>> Thanks,<br>> Corey<br>><br>> On Thu, Nov 19, 2015 at 2:02 PM, Jared Smith <<a>jaredsmith@jaredsmith.net</a>> wrote:<br>> ><br>> > On Thu, Nov 19, 2015 at 10:14 AM, Matthew Jordan <<a>mjordan@digium.com</a>> wrote:<br>> >><br>> >> Would it be appropriate to summarize the current state of things as "we<br>> >> need a spec file for Asterisk"?<br>> ><br>> ><br>> ><br>> > At one point, there was an awful .spec file in the Asterisk sources...<br>> > hopefully it's not around any more.<br>> ><br>> > That being said, I just took over as the main maintainer/contact for the<br>> > Asterisk packages in Fedora/EPEL -- It's one of the most complicated spec<br>> > files in Fedora, but that obviously hasn't scared me off.<br>> ><br>> > I'd love feedback on things we can do to make those packages better, and get<br>> > a tighter feedback loop between the Asterisk development community and the<br>> > packagers in Fedora/RHEL/CentOS/etc.<br>><br><br>--<br>Leif Madsen<br>Director of Engineering, Product Development<br><a href="http://avoxi.com" target="_blank">http://avoxi.com</a><br> </div></div>
</blockquote></div></div>
</div></div><br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="text-align:-webkit-auto;color:rgb(0,0,0);margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b><span style="font-size:14pt">Leif Madsen</span></b></div><div style="text-align:-webkit-auto;color:rgb(0,0,0);margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:9pt;font-family:Verdana,sans-serif;color:rgb(89,89,89)">Director of Engineering, Product Development</span></div><p style="margin:0in 0in 0.0001pt;text-align:-webkit-auto;color:rgb(0,0,0);font-size:11pt;font-family:Calibri,sans-serif"><span style="color:rgb(31,73,125)"> </span></p><div style="text-align:-webkit-auto;color:rgb(0,0,0);margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="color:rgb(31,73,125)"><span style="font-size:15px;text-align:-webkit-auto"><img height="55" width="151" src="cid:image001.png@01CDA633.92144FC0"></span></span></div></div></div></div></div>
</div>