Let's talk about variables.
Container images are generic by nature.
I mean, you put it from a public registry.
How would you ever want to have some specific information
in there?
This site-specific information must be passed separately.
And one way to do that in a standalone container
is by using variables.
Do you remember the MariaDB container
which failed when we troubleshoot it?
It was telling us about the MariaDB root password variable.
That's an example of one of these variables
that you can pass using minus e key is value.
So in the MariaDB case, minus e MariaDB root password
is very secret, or whatever you want to use.
Let me show you how this works.
OK, before doing this demo, I want
to do a quick Popman search, MariaDB.
Now, I want to do this because in my slides,
I have fully qualified container names.
But throughout the years working with Popman,
I have noticed that they do change.
And there's always a risk that you
try to do something that was working
at the time I was doing it.
And suddenly, they change something
and it doesn't work anymore.
So let's do a Popman search MariaDB.
And even a grep 10.11, because that's what I want to see.
And there we can find that we need
to be on registry.redhat.io.
And let's just use the rel 10 MariaDB 10.11.
It doesn't really matter which one we are using.
So if you try to follow along and you
get an error on your container message,
start with the Popman search before.
Then we can use Popman run minus minus name mydb
I want to give it a hard-coded name again.
And then I'm pasting the name of the container image.
And we will check what it is going to do.
Well, maybe we also want to do a Popman run minus d
to run it in detached mode.
So here it is trying to pull the image.
And oh, we have an invalid username password.
Apparently, I have not used this one before.
So let me use Popman login on registry.redhat.io
and log in with the credentials.
Again, something like this happens on the exam.
Read carefully.
The information is there.
And you are not expected to use your Red Hat account to log in
because you're offline.
So read carefully.
Good.
Now I can use my Popman run again.
And as you can see, the image is pulling.
Do you see this one, by the way?
Skips already exist.
Now, that is an advantage of the fact
that container images are layered.
This layer apparently was already
downloaded from another container image.
And that makes it a little bit effective.
Good.
Popman ps minus a is showing in the last line
that MariaDB exited with a 1.
You are expecting something like that, right?
So Popman logs my DB is showing that you must specify
either of the following.
Now, it's kind of funny.
I'm running a MariaDB image.
But this MariaDB image seems to want my SQL root password.
Some MariaDB image need MariaDB root password.
Other ones need my SQL root password.
I would also like to show you another way of investigating,
which is Scopio.
It's a little bit of an advanced utility
and might come in handy.
Scopio inspect is followed by a URI.
And the URI for OCI containers is
docker slash slash, which is followed
by the name of the container image that you want to use.
So rel 10 MariaDB dash 1011.
Now, the fun thing about Scopio is
that Scopio is inspecting the image without pulling it.
Fail to obtain authentication.
Let's try that again, because I understand I'm using student.
And then I need to do DNF install Scopio.
And now we can do the Scopio inspect.
It always takes a while, because it
needs to fetch all the information from the registry
to generate the result. And there we can see the result.
Well, feel free to read the result.
And in the result, you might find information
about what is required.
Look at this one, for instance, a usage example.
That's interesting.
And if you scroll up, you most likely
are going to find more useful information.
Now, let's try it again.
But before I'm going to try it again,
my previous mydb filled.
So I need pop in RM mydb to delete it.
And now I can run my previous command again.
And I'm just going to look it up,
because we are going to use everything
that I've used before with the additional option minus E.
My SQL root password is password.
And then what?
Well, pop in PS.
And then what?
Well, as you can see, mydb currently is running.
So this worked.
Now, I would advise, in order to avoid
wasting too much disk space, use pop in stop mydb, stop it,
and pop in RM mydb to remove it, because we are going
to run some MariaDB again.
And we don't want to end up with too many unused container
images.
Imagine if you do that on the exam.
You try so often every time a new environment is created.
And in the end, your disk is full.
Then you could fill the exam, because your disk is full.
You don't want that to happen, right?
So think about cleaning up every now and then.
Or be prepared to use LV resize to grow the size of your root
logical volume.
Sounds complicated?
Well, then you understand what you need to do.