Is it possible to install Ruby within a docker image, specifically Jenkins?

I can see from the docs that you can attach to a container or use `docker exec -i -t 4e2bf4128e3e bash`. This will log me in as `jenkins@4e2bf4128e3e`.

But if I try and install anything

```
apt-get install ruby 2.0.0 # Yes will install rvm, this is just an example

```

I get 

```
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

```

And when I try 

```
sudo apt-get install ruby 2.0.0

```

Then I get `sudo command not found`.