THE QUEST FOR THE PERFECT ARCH LINUX CONTAINER – #3 – makepkg

This is a small update from the previous post.

It’s now possible to build packages from within our humble container. I just did a commit with the following main additions:

  • install a couple of packages from the official repositories
  • create an ‘archer’ user (which is gonna be our general main non-root admin user)
  • disable password authentication for archer whenever using sudo
  • install cower, so we can easily and manually add packages from the AUR
  • install pacaur, so we can easily and automatically add packages from the AUR

As a small POC, I just updated the translate-shell package.

Everything is working okay, however this environment is still far from being called home. For now, it is just acting as a disposable container. There are still several inconveniences which I am hoping to fix and share in the next posts.

THE QUEST FOR THE PERFECT ARCH LINUX CONTAINER – #3 – makepkg

THE QUEST FOR THE PERFECT ARCH LINUX CONTAINER – #2 – Hello World

This post is part of an ongoing series about setting up a suitable Arch Linux environment for everyday use in a container. Previous post.

Recall: we’re starting from base/devel.

First things first…we gotta create a Dockerfile!

And now let’s make it more tidy and organized for deployment by using a docker-compose.yml file:

NOTE: The repo you see in the screencast is this one. The docs used as reference to create the docker-compose.yml file are here.

THE QUEST FOR THE PERFECT ARCH LINUX CONTAINER – #2 – Hello World

THE QUEST FOR THE PERFECT ARCH LINUX CONTAINER – #1

This post is part of an ongoing series about setting up a suitable Arch Linux environment for everyday use in a container. Previous post.

Container technology

No discussion: docker (wiki). For the sake of completeness, other options include: systemd-nspawn (although it is limited to Linux hosts running systemd), runC and low-level wizardry with LXC.

Where to start from?

We have to choose a image to start FROM. A few Google and Docker Hub searches yield the following options:

There are lots of options other than these, and there is also the option of rolling our own base. After a few hours of code inspection, I’ve decided to go with base/archlinux.

There’s also another variant: bash/devel. It just adds another layer atop base/archlinux, with the packages from the base-devel group, which is exactly what I would have done anyway, therefore I am starting with base/devel.

THE QUEST FOR THE PERFECT ARCH LINUX CONTAINER – #1

The quest for the perfect Arch Linux container – #0

Dear all,

This innocent blog is getting lots of attention from its humble author these days. This time, he is all in to start a new blog series about — heck, you already read it in the title.

It’s worth it to highlight that creating a series is very costly, both by being time-consuming and in terms of documenting its steps. Previous series included:

Motivation

To truly understand motivation, some context is needed. So, briefly: I’m a former Arch Linux community contributor, having spent almost 2 years using the OS and diving into its ecosystem[1], interacting with my peers everyday.  The next logical step would be to apply to become an official developer or a Trusted User (a person responsible to maintain packages and ensure quality in the [community] repo), and in fact I almost did that; however, at the time, I had to interrupt my involvement with the community because I participated in a study-abroad program. By the same time, I migrated to MacOS, which I’m using nowadays.

However — heck — migrating to MacOS doesn’t imply an automatic migration to the Apple ecosystem and culture. In fact, my (let’s say) baseline is still Arch.

That said, I am still using MacOS. What the hell? Am I that hypocritical and insincere?

So, let’s review the options (note to the reader: I tried them all):

  1. Replace MacOS with Arch Linux in my Macbook.
  2. Dual boot MacOS and Arch Linux in my Macbook.
  3. Use only MacOS in my Macbook.

I want start with the second one: it’s classical and very tempting, and it seems to solve all the problems. However, it could also be a mistake. “Less is more” and “do one thing, and do it well” are two Unix philosophies that won’t agree with this. I’ve tried this approach twice and they both failed. Why? Maintenance burden and lack of utilization of one of the systems. If you have to log in everyday in your workstation and then choose one operating system to boot in, you likely won’t boot into the other one for the rest of the day. And for the rest of the week. And for the rest of the month. Therefore, you end up with one operating system you likely won’t use. It would be better to invest this energy in just one OS, then.

The first option (using Arch only) also seems reasonable, but there are some moments in your life where Linux doesn’t suit it all. Ever needed to open a DRM’ed Acrobat Reader document? To use your printer or scanner with no-hassle? I could enumerate a few common things that might be needed to be done every once in a while. Some of them can be done in Linux with some effort (and time); others are simply not supported or even possible. That’s when having a MacOS (or a Windows) box helps. They are commercially supported OSes. It doesn’t matter whether you hate their lack of open-source: they are business standards.

The workaround for the previous paragraph is to have an Arch OS with a Windows VM. Yes, it definitely works. However, why would you do that if you have a Macbook? It’s way more efficient (especially hardware-wise) to use a native MacOS. That said, option #1 is totally okay, as long as you have a second computer with Windows to help you every now and then, or as long as you don’t need commercial support at all, ever.

And then we get to option #3: to use MacOS only. Here are some side effects I experienced with that approach:

  • I stopped interacting with the Arch community everyday, and I didn’t replace this interaction with anything else — to be honest, Stack Exchange is a good community to interact with, but it is not social — it is a strictly technical, Q & A forums.
  • I stopped learning everyday. OK, let’s be more precise: of course I still learn everyday; however, I used to learn everyday way more with Arch (or Linux, for that matter) than I do with MacOS. Since most things work out-of-the-box and with no stress in MacOS, I feel like a spoiled child with no problems to solve, no programs to compile, no configurations to tweak. This is harmful to a developer / programmer who wants to grow more and more — you can increase your expertise and ability only if you fail and then recover constantly.
  • I stopped putting the OS in the way, so I stopped worrying about a lot of things that I (as a programmer, developer) should worry about.
  • I stopped contributing to open source. Again, being more precise: I still contribute to open source, but way less than what I was used to before. An easy way to see that is with bug-wrangling and bug reporting: nowadays I mostly don’t care whether a given piece of software is or isn’t working. If it is not, [in general] I simply move to an alternative, like a spoiled kid who throws her smartphone away and gets a new one from her parents. Back into a few years ago, I used to care about most software I had installed on my computer, tracked bugs, tried to fix them or to find solutions for them. I even wrote blog posts about them and ranted about them in social media.
  • This might sound surprising, but it is also worth it to be highlighted: I decreased my serendipity massively. Heck, this blog is named after this awesome and beautiful word, yet I am saying I lost a big part of it thanks to my change to MacOS only. Well, of course the internet is full of articles and news, as life is full of people and friends. However, not all news and not all people are good. It’s like an expression we have in Portuguese: “diga com quem andas e te direi quem és”.

On the other hand, there is no need to dual boot Arch with MacOS, because MacOS is very good these days, even if you ignore all the fluff and distraction. Terminal.app and HomeBrew are the only utilities you need 99% of the time.

That’s how I came up with the container idea: it is an hybrid between “having MacOS only” and “still having Arch around when I might need it, but not with a full, overblown VM”. And it still provides a way of getting involved again with the community.

There are lots of issues coming through: this journey won’t be trivial. But I think it can be done and it will be a good experience, so it is worth it to spend some time to create a series about it.

That said, here is a disclaimer: sometimes I start a series but don’t continue it. But I am confident this time I will see you soon in the next post. Until the next time!

Footnotes

[1]: it’s not just the operating system. There are lots of idiosyncrasies and philosophies surrounding the Arch environment.

The quest for the perfect Arch Linux container – #0