hi guys and welcome back to another IBRACORP video i'd like to take this moment just to thank each
and every one of you for clicking on the video for liking the video for subscribing to our channel
seriously guys every subscription just helps the channel grow and helps me give back to you a big
thank you to everyone who subscribes to the channel that's really appreciated as well as
everyone who signs up to the website in today's video we're going to jump straight into your
docker tips and tricks some of these are old some of them are hoping you're new there's people that
are still sort of asking me some of this stuff as recently as today so i thought this would be
a great opportunity to just put them all into one video so let's see what you think if you think it
was useful if you think it could be improved just drop it down in the comments let other people know
these are some of the things i think are pretty helpful to people either the beginners
or they just aren't aware of these features as usual our motto is let's get stuck into it
all right so we're in our unraid server as you can see we're running
version 6.9.1 which i've already covered upgrading to 6.9.1 and it's looking pretty
good all right everything's set up we've got our containers running we've got all of these
containers that we've also done videos on how to set them up so they're all running perfectly fine
we're pretty happy no worries we're not going to worry about that stuff too much today in terms
of getting an app running we've done that plenty of times today i'm just going to cut to a couple
of these tips let's start with the first one in unraid if you are in the docker tab which
we are here as you can see and you select the basic view to advanced view in the top right
it's going to give you a couple more options here for a start you start getting a lot more
information that you can't see in the basic view if i switch around you can see pretty nice and
clean click it again we start getting all sorts of other information here we've got the ids who the
repository owner is and a couple of extra details the first tip i've got for you is auto start and
auto stop all right seems pretty straightforward if you just toggle the option here you'll be
able to auto start those containers if your server was to restart or docker was to restart
what you may or may not know is once you hit the auto start
it allows you to have a wait option say right here which is in seconds
what that means is if i was to put 10 seconds in this one this would start up instantly it would
then start this one instantly but once this one starts it will wait 10 seconds before it executes
the next one just a handy tip there you can use it to stagger out your server startup pretty helpful
if you've got containers that take a little bit to start up and they might have dependencies
which takes us on to our next tip the next tip with unraid and docker is that the order that the
containers start is actually top to bottom this is one i get asked frequently and i'll explain
anytime you have something set up with a database for example we've got mariadb here you usually
want the database to start up first the reason is a lot of things depend on the data in the database
so what we'll do is move the database higher up in this list using the arrow option on the right hand
side same with redis that's also a transactional database so that way we can make sure that these
two run first and unraid will start them first in the order from top to bottom the next tip i've got
for you is custom docker networks now if you look at the network here this is one i get asked about
a fair bit you'll notice that i have my own custom network here it's been covered plenty before but
people still ask so i thought i'd throw it in here so if you don't know how to create
a docker custom network it's as simple as this in your unraid screen just open up the terminal
which you'll find in the top bar i'll move that over here so here's our terminal in the terminal
type in docker network create and the name of the network you want to give it caller ibra test
right pretty simple straightforward hit enter there you go that's just created a custom docker
network so we'll close this and we'll refresh just make sure we've got that we'll go into a container
and in the container screen under network type is our custom network ibra test
now some of you might be asking what's the benefits of a custom docker network the first
benefit is that the containers are all talking to each other on the same ip address subnet
the other thing is it allows you to set a specific ip address for that network
if you switch it to bridge you don't have that option neither in host
allowing you to have a custom network means you can have a fixed ip address for that particular
docker container another benefit that you may not know is when you have them on the same docker
network you can allow them to call each other by their container name rather than an ip address
or port number and this is pretty useful if you're using something like nginx for example whether
it's swag or nginx proxy manager if it's trying to call to another container having them on the same
network means they can use each other's names so i can just type in nginx proxy manager rather than
192 168 etc etc so that's another handy feature there we'll move on to the next one in the docket
containers if you would just open one up and we've got the advanced view ticked up here as
you can see we'll just tick advanced again scroll down and you'll see these fields extra parameters
and post arguments extra parameters will allow you to actually link to other containers sometimes you
might be following documentation of a container and it might say you need to put in something like
this for example dash dash mariadb in those cases especially if it's something like docker compose
it might be just trying to refer to the link to another database so that's where you would enter
that information the next one while we're on this screen is mapping parameters so if you're
looking at a docker run command i'll just try to bring one up for us so here we are on postgresql
on docker hub and you can see that it's got a docker run command now what you're looking at here
are environment variables so this this environment variable for example postgres underscore password
will allow you to put a secret password and map that on startup and you'll find on docker hub
or a lot of these docker containers they actually have a lot of variables that you can map yourself
and these will allow you to map them on startup and avoid having to do them in the actual user
interface of that application so that every time you start the container that information is mapped
on startup and is persistent across restarts so in order to do that you can say postgres underscore
password we copy that now i understand this is not a postgres container guys so bear with me okay i'm
just doing it for example's sake you can just go add another half port variable etc etc and under
here you would go to variable under the name just give it a name so we know it's a password
field you might want to give a password the key is the actual parameter or the variable name so
this one here you can see it's signified by this hyphen e we go back put the key there
that's done now you don't need to put a semicolon or anything like that just the key then the value
is the actual password in this case so whatever it is you want to put you can then customize the
default value if you were creating a template i have a separate video on creating templates
if you wanted to get a template onto the app store and whether you want to mask it so for a password
you probably want to mask it for example we click add there it is there all right now you can't just
do this with any container you need to go to the container on docker hub and make sure that those
variables actually exist you know have a read of the documentation it will tell you if they
have variables that can be passed through so just like here environment variables perfect example
so you've got this option you can put the user if you like and you want to put all this other stuff
you can do that on startup anytime you want and you can do that on any container even if it's from
the community app store on to the next one cpu pinning now if we just click advanced view again
if we come down under here you'll see cpu pinning you see on this server we've got four cpu ports
that we can pin and if you check them you can allow the server to manage it a little bit tighter
and say that okay i only want this container to use one cpu that's it that's all i want it to do
and if it you know stretches that one cpu out it's not going to stretch out our whole server
another important one guys i noticed that when people report issues on for example the unraid
forums or my container for ophelia uh quite often they're not providing the logs so for cachet url
monitor here for example we'll just left click and click logs you can see this one hasn't been
starting so it's actually been pretty quite faulty if i scroll up you can start having a read and
see what the issues might be now if you're not an expert in development you know maybe the messages
you're seeing aren't very clear sometimes they'll just tell you what the problem is in clear english
in other cases it might give you a bunch of stuff that really makes no sense in either case this is
the information that you need to share with the community when you're asking for help the logs
are very important it also allows you to see what the container is doing right from the minute you
start it up now the last thing i'll probably tell you about because that really covers i think most
of the stuff that a lot of people might want to know with containers updating and backing them up
it's essential that you're doing that if you are looking at updating your containers if you're
using the auto update plugin and the app data backup plugins which i covered in the last top 20
plugins video sometimes there are containers that you don't want to automatically update or you want
to have a little bit more control of when they're updated i'll show you what you can do about that
you click advanced on the container it actually gives you the link directly to
docker hub so we'll go to that so here we are on the docker hub for nginx proxy manager
and if i just go to tags here's a list of tags that are currently listed and the different
versions that are available so every time a version comes out it'll come with a version number
or you'll have the latest sometimes there are multiple tags with the same version number but
they are different architectures so also something to make sure you read so let's say for example
i only wanted to keep version 1.14 i don't want it to upgrade past this version until i'm ready
to upgrade it by default most containers just have latest in there or they might not have
anything which will always pull the latest image if you wanted to set it to a specific version
back in the container screen here under advanced view you see you've got the repository line so on
the repository line as you can see it's just got the name that is basically going to be pulling the
latest all the time but if i wanted a specific version you put in two dots just like that
and paste the version number that we just saw as it's listed here because this is actually
how it's written so this is the version that we want so version 1.14 for example
then come down click apply wait for that to run it will go and pull that version down and click done
engine x proxy manager is now running and it's running on that version that we asked it to 1.14
so that's how you set a specific version the other alternative of course if you don't want to do it
that way is through the auto update application plugin instead of having automatically update all
of them we'll go to docker here click no and then you can just check off the ones you don't want to
update so that's pretty much it guys i hope that covers some important parts of docker on unraid
and some container information for you if you found it helpful please consider subscribing
give us a like on the video a big thumbs up chuck a comment down below on what you think are the
most useful tips for a beginner or an advanced user when it comes to docker we'd really love to
see your feedback thank you again for watching an IBRACORP video and we'll see you in the next one
cheers
you