How to Use Container Manager (Docker) on a Synology NAS - Beginners Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
if you've ever wanted to create a Docker container on a Synology Nas it's now done through the application container manager now container manager for all intents and purposes is the exact same thing as Docker used to be on versions of DSM prior to 7.2 however container manager is actually a better overall application outside of that little confusion that was added by changing it from Docker to container manager it still runs Docker containers and it's even more powerful than it used to be in this video we're going to walk through the entire process on how to configure container manager the goal is to allow you to understand how container manager works so that you can then go in and create different types of containers based on whatever you want to implement so to get right into it when you launch container manager you're going to be brought to the overview tab if you don't have any Docker containers running this tab won't show anything but as soon as you set up a few Docker containers this tab is going to show all the different services that are running and some help full information however for the most part you can ignore this tab the first tab that we're going to look at is the registry tab I want to start here because this is where you're going to download your individual Docker images now you don't have to do it this way but the reason I want to start here is because after you download a Docker image it will go to this images tab and from there you'll be able to select that specific images then select details and click the docker Hub link this is very important the reason I'm starting here is because you need to create Docker containers based on the documentation that already exists if you start here you'll be able to understand how all this works and then go in and Implement your own Docker containers now the documentation is different based on whatever you're trying to create so in this tutorial I'm utilizing pie hole however you can utilize any Docker container that you want you just have to understand how to read the documentation so when you access the documentation since it'll be different you might not actually see what I'm displaying here however it'll be something similar so that's the caveat with this is that it's going to be slightly different based on whatever container you're trying to create but the general gist is the same so the reason I wanted to start with the documentation is because this pie hole image actually comes with a default Docker compose file that you can use that's the biggest change in container manager from the old Docker application Docker compose can now be used in the front end rather than the back end you were always able to use Docker compose on Synology NASA's but you had to do it through the command line interface now you can do it straight through the container Manager application the reason I'm pointing this out and I'm starting here is because for the majority of people I think you should get comfortable with this and create all of your Docker containers this way you don't have to and we'll get to the other way you could do this a little later in the video but if you understand how this works your containers are going to be portable with a Docker compose file what that will allow you to do is if for whatever reason you wanted to migrate these containers to a separate device I'm not even talking a separate scenario I'm talking a completely separate device with a separate operating system what you can do is utilize the exact same Docker compose file change a few parameters around potentially but have your container up and running in no time what that allows you to do is basically maintain the configuration of the docker container but allow you to keep it portable so you can move it off if you ever had to now I want to point out that the important data for this Docker container will always exist on your nest so if you ever had to move it off somewhere else you could do that you could reconfigure it and everything will stay as is however this allows you to keep the actual configuration portable as well so to quickly walk through this Docker compose file you're going to see here that the container name is pie hole the image displays as pie hole and for the ports it has the default ports of 53 for TCP and UDP 67 and 80 for TCP as well 67 was UDP a few other important things here time zone is listed as America Chicago you can change that and the web password it's commented out currently but if you uncomment that that would allow you to go in and create a password for the pie hole admin interface very important the next important section here is going to be the volume section now the volume is basically what allows you to map the container folder to a local folder so when I said a little earlier that if you ever want to move this container to a separate device all your important data will exist this is the section where you specify all of that so your goal here is to map the container folder which will always stay as whatever's in the actual Docker compose file to a local folder on your Synology Nas when we copy this over we will get to this section for now just understand that this volume section has to be modified and it is very important now based on the actual container that you're using some of these other settings are going to be different so for the most part for pie hole all the settings I just talked through are the important ones so what we're going to do is we're going to copy this we're going to head back to DSM and we're going to access the project tab now the project tab is where I think everybody should live if you're using Docker on DSM 7.2 or later this allows you to utilize Docker compose and it allows you to maintain everything inside of this tab so what we're going to do is we're going to create a new project we're going to give it a project name of pie hole and we're going to set the path the path is very important now when you install container manager a default Docker folder will be created that Docker folder is very important this is where you're going to map all of your containers and their important information too so if the folder that you want to use doesn't exist what you could do is open up file station and create a new folder inside of that Docker folder so what I'm going to do here is open up file station create a new folder named Pi hole and then inside of the project settings I'm going to select that folder now at this point after we've done that we have our project name filled out and we have the path set the third section we're going to use is we're going to change that to create Docker compose.yml this is a yaml file so to go back a little bit Docker compose files are actually yaml files yaml files is just a specific format that the file is written in it's not super important but it's important to understand that you're adding the actual data inside of this Docker compose file in a specific format so maintain the format and you'll be fine now when you create a new Docker compose file what it's going to do is it's going to create that Docker compose file inside of that path that you created every single container will have a separate Docker compose file so remember that don't just pick the uh the default Docker Library go in and make sure you create a subfolder because that'll make your life a lot easier now when you paste in that Docker compose file this is where you can go through and configure and or change anything that you have to so the first thing in this container that we're going to change is we're going to uncomment the web password and we're going to put in our own password this is what we're going to use to access the pie hole admin interface you can also go in and change the time zone if you want to I'm going to leave that as the fault for now now the volume section is very important like I said earlier this is where all of the important container specific data will be written so right now on the left hand side of the colon we have the local folder that you want this data written to everything after the colon can stay as is that is the container path so on the right hand side container path on the left hand side local folder so what you're going to see is that the default data is written as period forward slash Etc pie hole colon forward slash Etc forward slash pie hole so what that means is that it's looking for a local folder in the root directory Etc Dash pie hole naturally that doesn't exist so we have to modify this what you have to do is you have to modify that entire path it's going to end up being pretty long but just bear with me here so right now it's period forward slash Etc pie hole we're going to remove all of that what we have to do is we have to first get to the docker folder so it's going to be forward slash volume one forward slash Docker that's default if for whatever reason you've installed container manager on a separate volume you might have to use volume two even volume three but for most people it's going to be volume one if you don't know where that Docker folder lives you can open up the control panel go to Shared folders and inside of there it will show you exactly what volume the docker folder lives on all right so now we're at the docker folder so what we did is we created a pie hole folder inside of that Docker folder now you don't want to write everything to the pie hole folder so what you want to do is you want to create a subfolder inside of that pie hole folder so now to look at this from a file station perspective we have the docker folder we have a subfolder inside of that called pie hole we're then going to have a subfolder inside of that called etc-piehole what I normally do is I just match the the exact value that's written in that Docker compose file but realistically you can use anything this can be called whatever you want you could call it blue if you want it doesn't matter the important point is that you have to understand your mapping a local folder to a container folder now what this means is that the contents of the ETC forward slash pie hole folder from the container itself will be written to this local folder you'll do the exact same thing for as many folders exist inside of this volume section based on the container that you're using it could be different there could be more or there could be less what you have to understand is that you're going to go inside of this section and you're going to map all the container folders to local folders so I'm going to go through inside of this Etc DNS mass.d folder and I'm going to do the exact same thing one more thing I want to point out is that the actual folder must be created inside of file station so it won't automatically create subfolders make sure that whatever you set as the actual volume will be set inside of the file station as well so file station should match whatever folder path you're setting and the folder should be created now you can go in here and you can modify anything else that you want to modify the important things I want to point out that you could potentially want to change are the port values you might want to change the restart status if you don't want it to always restart you might want to change some other environment variables but for the most part anything that you set here is what's going to be used now is your opportunity to change any of those settings around if you don't want to change anything or if you've already changed everything you can proceed through here and create the container now you might run into problems one common problem that you might run into is that the port that you're trying to use is already in use now on Synology if you try to use port 80 for example you might have to change that that's why I went through and I changed that from 80 to 80 80. it has to be something that's not currently in use if you want to use completely separate Port values you have to create a Mac VLAN network interface which we'll get to a little later now assuming that you configured everything correctly the container will go through build and it will be created at this point the container is created you can go in and you can configure it now it's going to be different based on whatever container that you're using but from a configuration standpoint the container is created now inside of the containers tab that's where you're going to see all of your running containers for the most part this is where you'll go through and you can manage everything if you want to stop any containers if you want to view the details of containers you can do that all here however you can create containers for this as well but like I said earlier my personal preference at this point in time is to use Docker compose if you don't want to use Docker compose or you're just interested in creating containers using a GUI interface you can follow these instructions now before we create a container what I want to point out is that for the most part everything that we've learned from a documentation standpoint will hold true here as well so what that means is you have to understand what volumes you want to map you have to understand the port settings and for the most part what you're going to do is take that Docker compose file that we looked at a little earlier and you're going to replicate that by using synology's GUI so inside of the first create tab what you're going to do is you're going to select the image you're going to give it a container name you're going to enable auto restart for most containers if you don't want to automatically restart the container you can keep that checked off the other thing that you can see here is resource limitations if you want to change any of that you can so this is that top section in the docker compose file that we looked at a little earlier moving on to the next section we're going to be looking at the ports now on the right hand side same thing with the docker compose file the ports are going to be listed here these are going to be the container ports if you want to map these to something different meaning a different local Port you'll have to change that here so earlier for pie hole I used 8080 for the default port for the container Port 80. I know it's confusing but bear with me here so the local port 8080 will point to The Container port 80. that's what I just set here now as soon as you do that you're going to see the volume section now the volumes you're going to go through and you're going to add new folders and you're going to set the local path and then you're going to set the container path the only difference is rather than having the container path specified you're going to have to type it in the other thing I want to point out is right here you can see that they have a read write or read only option for the most part you're going to use read write for all these containers but there are very very unique situations where they might be read only but once again it depends on the container that you're going to be using after you change the volume settings you can then go through and change any environment variables is the same thing we looked at earlier so for example we change the web password earlier you can change that here if you're using pi hole there could be other environment variables as well but it depends on the container moving further down here most containers you don't want to run as high privilege when you set a container to use high privilege you're allowing it to run as root I generally advise against that if you can avoid it I know there are certain circumstances where I think containers need it but for the most part you're going to leave that as is and then in the network section generally you'll use Bridge or host if you're using a Mac VLAN network interface you'll have to select it in this list but you have to create the Mac VLAN network interface first so we're not going to go through the actual setup process of that but we will look a little later at the command that you can run to create a Mac VLAN network interface and if you use that command and you create a Mac VLAN network interface you'll see it in this list here so then you can go through and you can select it here for the most part all of your settings now are configured for this container so if you compare this back to that Docker compose file they should match for the most part there might be minor differences here and there but all of the important configuration changes that you made in the docker compose file you would in one way or another have to interact with synology's GUI and make them here so at this point the docker container is created and once again in this container section you're going to go through and you can manage the docker container so what we did here is we created at first a Docker container using a Docker compose file that utilizes the project tab if you want to create just a Docker container without a Docker compose file ignore the project tab entirely go to the containers Tab and then you're going to create it inside of there regardless the way that you create the container is relevant the important part is that the container gets created you're either going to have a Docker compose file or you're not but the important data will always exist in that Docker folder on your Nas that's important to understand now finally before we move on to a Mac VLAN network interface it's important to understand that in the image tab here all of your images will periodically check for updates so if you go inside of here and you see update available what that means is that there's a new version of the image this is where it gets a little tough if you want new functionality new features potentially bug fixes you might want to install that update however I have run into issues in the past where updates cause different issues to break So based on what you're doing based on what you're using you have to make the determination on if you want to update the container or if you don't if you're using a container and for whatever reason you're exposing it to the external internet you probably want to update the container if it's running locally and it's a media server for example and everything's functional you could potentially add new issues into the mix that you didn't have in the past so go through make sure you do or you do not want to update the container but if you do it's a one-click option here update the container and then it'll be updated now Mac VLAN network interfaces this is a tough one because for the majority of the containers that you use you don't have to be anywhere close to this but for Unique containers and pie hole is kind of unique in this case you are going to want to use a Mac VLAN network interface like I said earlier a Mac VLAN network interface will allow you to have a completely separate set of ports so using pie hole as an example we had to change Port 80 from the container port to the local Port 8080. the reason is because the NASA itself utilizes Port 80 for its reverse proxy if you try to create the container using Port 80 it's not going to work you're going to run into errors what a Mac VLAN network interface does is it basically completely avoids any port conflicts you might run into because that container will be accessible on its own IP address with its own set of ports now this Mac VLAN network interface can only be assigned to one container and you have to create it off of an individual network interface so most Nas devices have two separate Nicks on the back that you'll plug your ethernet cables into if you create a Mac VLAN network interface you'll generally be creating it off of one so theoretically you can create two different Mac VLAN network interfaces both on separate physical interfaces a little confusing but I do want to point out that if you're using a bond network interface it could get even more confusing realistically you're going to have to play around with this a little bit but for most people in a standard default setup you can set up a Mac VLAN network interface to avoid any of these Port conflicts now in order to create a Mac VLAN network interface you have to SSH into your Nas I have a tutorial in the description of the video where you can go through and it will show you exactly how to ssh in as soon as you ssh in what you have to do is you have to find out the IP address and the interface name the interface name is very important because you're creating the Mac VLAN network interface off of that interface name from there it's basically a default setup the only difference is you have to change the subnet to be whatever you're using on your local network and you have to go in update that interface name and then you have to select an IP address this IP address has to be something that's not currently in use on your network and that IP address is how you will access whatever Docker container you apply this network interface that you just created too so I know it's confusing but you go through you create the Mac VLAN network interface as soon as the network interface is created you can go in and you can apply it to an individual container one and then when you apply it to that individual container you'll remove the bridge interface or the host interface whatever was there and then finally you will access that container using the IP address you specify here now I'm explaining how this works so you can understand how it works but for the most part if you need a Mac VLAN network interface you're probably going to know it because you're going to run into Port conflict issues you're not running into Port conflict issues or you're even willing to just use a different local Port like we did earlier you can avoid this entirely I'm not showing you this because I think you need to use it but I am showing you it because it's important to understand how it works so that is a very long overview on how container manager works on a Synology Nas the goal of this video is that hopefully if you watch this entire video through you understand how to go read documentation and apply it to synology's interface whether you're using a Docker compose file or you're using Synology Scooby the process is the same for every container that you might create however the individual settings will be different but if you follow this and understand how it works you should be able to implement different types of containers so I'm hopeful that this video helps you out if it did please consider giving it a thumbs up if you like this type of content also please consider subscribing to the channel if not thank you and I'll see you next time
Info
Channel: WunderTech
Views: 28,090
Rating: undefined out of 5
Keywords: synology nas container manager, synology container manager, container manager, container manager synology, synology nas docker, docker synology, docker synology nas, synology docker
Id: aUFpdjfDI6c
Channel Id: undefined
Length: 21min 53sec (1313 seconds)
Published: Sun Sep 03 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.