Installation of packages inside the container

Hi All, I executed a Job with an ubuntu image and if I connect inside the container to install a package I receive this error:

root@3f13542325d4:/# apt-get upgrade
Reading package lists… Done
Killed

I don’t get the same error if I execute the container with Docker.
Can you tell me why?
Thank You

Hi @ssignori76,

Would it be possible to share the job specification you’re using, so I can test this locally?

Thanks,
jrasell and the Nomad team

Sure, I didn’t mentioned that I’m using nomad in dev mode.
This is the job, I connect to ubuntu task to install new packages.
Thank you

job “httpd” {
datacenters = [“dc1”]

group “FE” {
count = 2

network {
  mode = "bridge"
  port "http" {
    to = 80
    # host_network = "public"
  }
}

volume "test" {
  type = "host"
  read_only = false
  source = "test_volume_h"
}

task "httpd" {
  driver = "docker"

  service {
    address_mode = "auto"
    name = "http-server"
    provider = "consul"
    port = "http"
    check {
      name = "http liveness check"
      path = "/"
      type = "http"
      protocol = "http"
      interval = "10s"
      timeout = "2s"
      on_update = "ignore"
    }
  }

  config {
    image = "httpd"
    ports = ["http"]
  }

  volume_mount {
    volume = "test"
      destination = "/var/lib/volume_test"
    read_only = false
  }

  resources {
    cpu    = 50
    memory = 50
  }
}

task "ubuntu" {
  # export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
  driver = "docker"

  config {
    image = "ubuntu:latest"
    command = "sleep"
    args = ["infinity"]
  }

  resources {
    cpu    = 50
    memory = 50
  }

  env {
   version = 0.1
   NODE_CLASS = "${node.class}"
  }

}  

}
}

With only 50MB of RAM, apt won’t have enough to run, and it gets killed by the OOM

1 Like

Thank you
Nomad trace this information?
I was able to find it only via journactl (i tried after your reply).

Hi @ssignori76,

Nomad trace this information?

I would start by looking at the allocation status of the failed allocation for additional details. It is worth noting that Nomad doesn’t act as the OOM killer, so system logs will also be important for analysing these kind of failures.

Thanks,
jrasell and the Nomad team

1 Like