Cant install additional software/packages inside container

Hi, I have just started with Docker only today and I have “beginner”. (hope this is right place to ask).
I have installed my first container like this: docker run -it ubuntu bash

Then I tried to install new package inside of docker container.
I follow some examples that I have google’d and it does not really work to me:

[root@centos7 ~]# docker run -it ubuntu bash
root@2869c7f4bb2e:/# apt-get install htop
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package htop

What am I doing wrong?

Not doing anything wrong! It just can’t find that package like it says. Which means, either that package doesn’t exist, or you don’t have the repos that contain it.

apt-get update
Then try again

Thanks for that.