Xenial machines have Trusty kernel?

Hi, I’m just starting out with CircleCI having learned about it at a recent github event. Thanks for providing an awesome service!

I’m trying to build something which requires a more modern kernel on the build machine than you currently provide. I’m using your version 2 format yml, and spinning up a xenial (Ubuntu 16.04) image to build in. Unfortunately it seems like the build environment is not using a xenial kernel (which I’d expect to be 4.4 or greater), but an old trusty (Ubuntu 14.04) one, of the 3.13 vintage. Specifically 3.13.0-107-generic.

Here’s the output of uname -a and cat /etc/os-release on the build machine I was given.

Linux a0031eadbf3c 3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
NAME="Ubuntu"
VERSION="16.04.2 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.2 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

Is there some reason why we can’t have the xenial kernel which goes with the xenial userspace?

Hey popey,

I’ve seen you around on Twitter and over at the Snapcraft forums. Welcome to CircleCI Discuss.

So it sounds like you are using CircleCI 2.0 here and are starting up the ubuntu/16.04 Docker image? Let me know if I have that wrong.

The issue here is in the way Docker works. Since Docker relies on lightweight containers rather than a full OS (like Virtualbox would), it doesn’t have its own kernel. Whenever you run Docker, it “borrows” the kernel that the host OS is running.

When using the docker executor, which it looks like you are, the host is running Ubuntu 14.04 with a Linux 3.13 kernel. I did some quick tests and running the machine executor gives you a base OS running Ubuntu 14.04 still, but with the Linux 4.4 kernel.

So I would try using the machine executor right now. It’ll give you a kernel meeting your minimum requirement, plus you’ll have docker and docker compose available to you should you need it. Unlike the docker executor though, you will need to docker run or docker exec to get commands to run inside the Ubuntu 16.04 container.

I hope that helps.

1 Like

Hey! Thanks for the prompt & detailed reply!

Your suggestion worked perfectly. I used the machine executor and used apt to install snapd so I could install the snapcraft snap, which worked a treat :slight_smile: Here’s the snippet:-

version: 2
jobs:
  build:
    working_directory: ~/emoji
    machine: true
    steps:
     - checkout
     - run:
         command: |
           sudo apt update
           sudo apt install -y snapd
           sudo snap install snapcraft --edge --classic
           /snap/bin/snapcraft

I got it all working and pushing to the snap store. I wrote it up on the snapcraft forums if anyone is interested :slight_smile: https://forum.snapcraft.io/t/building-pushing-snaps-using-circleci/789