So as we have already done a lot that looks like this
in previous demo, I'm on a different machine here.
And in this different machine, I will show you
what we need to do to run the registry
container as user student.
First, sudo loginctl enable linger student.
Did you think about that?
Because that's something that I've not shown in the last video
before this lab.
By using this linger feature, you
make sure that containers that are started
by quadlets by this user are automatically
going to be enabled on system boot,
even if the user doesn't log in.
And that's pretty important.
Then I'm using mkdir to create the registry persistent storage
that we are going to bind mount.
And now I need vim on tilde slash dot config containers
systemd registry dot container.
So that's a quadlet file.
And in the quadlet file, I need basically
what we have seen in the lesson in the video as well.
So image is docker.io slash library slash registry colon
two.
And then exec is slash entry point dot sh etc docker
slash registry slash config dot yml.
And next, I need the volume.
So volume is %h colon slash registry colon slash var lib
registry.
And let's make sure that SC Linux works as well.
It's pretty important not to forget the uppercase S.
And then publish port is 5000 colon 5000.
And we need the install section.
And in the install section, we have wanted by is multi user
dot.
And in the install section, we have
wanted by is default dot target.
Next, systemctl minus minus user daemon reload
so that the service file is generated.
And systemctl minus minus user start registry dot service.
And oh boy, this is not all right.
Well, some troubleshooting always comes in handy.
Happy to see it here so that you don't
have to find it out for yourself on the exam if it happens.
Let me use systemctl minus minus user status
on registry dot service.
It's always the best idea.
And oh, that's an interesting one.
Parsing container port.
Port numbers must be between 1 and 65535 got 0.
Well, then I think there can be only one thing that's wrong.
And that is the published port line.
Did you see that?
I made a typo.
So I need to make that 5000 instead of 000.
So now I'm going to do this systemctl user daemon
reload again.
And now I'm going to start it.
And starting it this time should work out all right.
Again, as this is the first time that I'm
starting the registry container on this system,
it needs to be fetched.
So that might take a little while.
Now, Popman PS should show that the registry container
is up and running.
There we go.
And that makes that this demo is now complete.
Well, one more thing that we need to verify.
And that is something we can only do after a reboot.
We need to make sure that it comes back,
even if user student doesn't log in.
So for testing, I'm going to log in as usual Linda.
Anybody but the user student, because we
want to make sure that the registry is coming up.
Even if user student is not logging in.
And Linda is using PSAOX pipeless.
Let's make that PSFAOX so that you see the process forest.
And then Linda is going to check for user student.
And there we can see conmon.
That's a container monitor.
That is how containers are started.
And look here.
Here we have registry serve.
And that makes that the registry is available.
And the other way that we can see that, SS maybe.
Sudo SS minus tune app.
Oops.
SS maybe.
SS minus tune app is giving me what?
It's giving me an overview of all the ports
that are currently listening.
And here we can see that port 5,000 is in a listening state.
So that is all.
Registry is ready for use.