MSSQL Docker on UnRaid


Recommended Posts

  • 8 months later...
On 5/26/2020 at 6:12 PM, Merrrp said:

I've been attempting to set up MS SQL Server too, I seem to get it up and running fine pointing the paths at /mnt/cache etc. (I'm using my own template repo here if it helps anyone, I'd also welcome any feedback on cleaning that template up a bit). I haven't given it any serious work to do yet so I may still run in to more issues.

 

The only issue I'm having currently is getting Unraid to detect available updates, I currently always get 'Not Available' - is anyone aware of a workaround for that other than an occasional force update? I'm guessing it's to do with MS using the mcr.* repo but I'm quite new to tinkering with Docker and these Unraid templates.

 

@Merrrp, thanks very much for your template - I'm using it successfully bar an issue with paths...

 

In the template I set both the data and log volume mounts and they appear to be mapped correctly:
DockerPaths.png.cf4bba74c4f2df78794dd9d24124ed56.png

 

...however, when I look at the server properties in SQL Server Management Studio all the Data, Log and Backup paths have all been set to the same directory /var/opt/mssql/data:

InstancePaths.png.2fdce013048dcf9c04b048049bb4a080.png

 

So it looks like setting the data directory is successful but not the log directory and there appears to be no way to set the backup directory. I know I can set them after the container is running using mssql-conf but I'd really like to have them set properly as part of the template.

 

Do you have any ideas what is wrong here? Thanks!

Edited by writablevulture
  • Like 1
Link to comment
  • 1 month later...
On 9/22/2021 at 4:04 PM, writablevulture said:

 

@Merrrp, thanks very much for your template - I'm using it successfully bar an issue with paths...

 

In the template I set both the data and log volume mounts and they appear to be mapped correctly:
DockerPaths.png.cf4bba74c4f2df78794dd9d24124ed56.png

 

...however, when I look at the server properties in SQL Server Management Studio all the Data, Log and Backup paths have all been set to the same directory /var/opt/mssql/data:

InstancePaths.png.2fdce013048dcf9c04b048049bb4a080.png

 

So it looks like setting the data directory is successful but not the log directory and there appears to be no way to set the backup directory. I know I can set them after the container is running using mssql-conf but I'd really like to have them set properly as part of the template.

 

Do you have any ideas what is wrong here? Thanks!

 

@writablevulture

You're welcome, glad it helped!

I've checked my configuration and I see the same paths showing in the SSMS server properties window, but when I check the contents of the paths I've configured I can see things appear to be going in the correct places on disk.

 

After some digging I've realised I think it's just the naming of things being confusing. The two settings in the template are for the container paths whereas it sounds like you want to configure the server DB defaults within the container? If so I suspect what you want might be these docs:

MSSQL_BACKUP_DIR	Set the Default backup directory location.
MSSQL_DATA_DIR	Change the directory where the new SQL Server database data files (.mdf) are created.
MSSQL_LOG_DIR	Change the directory where the new SQL Server database log (.ldf) files are created.
MSSQL_DUMP_DIR	Change the directory where SQL Server will deposit the memory dumps and other troubleshooting files by default.

 

It's a little while since I looked at this so I'll sort out updating my template in due course, hopefully it helps folks get started.

Link to comment
  • 1 month later...
On 10/24/2021 at 10:45 AM, Merrrp said:

After some digging I've realised I think it's just the naming of things being confusing. The two settings in the template are for the container paths whereas it sounds like you want to configure the server DB defaults within the container? If so I suspect what you want might be these docs:

MSSQL_BACKUP_DIR	Set the Default backup directory location.
MSSQL_DATA_DIR	Change the directory where the new SQL Server database data files (.mdf) are created.
MSSQL_LOG_DIR	Change the directory where the new SQL Server database log (.ldf) files are created.
MSSQL_DUMP_DIR	Change the directory where SQL Server will deposit the memory dumps and other troubleshooting files by default.

 

Thank you, these variables work as you describe.

Link to comment
  • 3 weeks later...

I have been using the template from Merrrp's GitHub repo mostly without issue. However, I got a werid warning from the Fix Common Problems plugin this morning:
 

Quote

WARNINGS FOUND
Template URL for docker application SQLServer is not the as what the template author specified.

SUGGESTED FIX
The template URL the author specified is https://raw.githubusercontent.com/patrickstigler/unraid_app_templates/main/mssql-server/mssql-server.xml. The template can be updated automatically with the correct URL.

 

But this is really confusing me because the URL specified in the fix is in someone else's repository entirely and I have never made reference to that repository in unraid before.

 

Does anyone understand how that warning can come about or what I should do about it?

Link to comment

Because the template that you installed via the forum isn't in CA due to 

Quote

Taddeusz' Repository
    mcr.microsoft.com/mssql/server:2019-latest:
        Fatal: No valid Overview Or Description present - Application dropped from CA automatically 
 

Because there is a new valid template within CA, FCP wants you to switch to using it's template URL of the valid template.

  • Thanks 1
Link to comment
  • 2 weeks later...

For MSSQL 2019 the permissions for the container has changed from 'root' to 'mssql' so not the local mapped drives need to have the same permissions

 

Ref:
https://stackoverflow.com/questions/65601077/unable-to-run-sql-server-2019-docker-with-volumes-and-get-error-setup-failed-co


Fiddle with folder directories for your server.
 

1.
Start the MSSQL2019 container.

2.
From the command line in UNRAID copy the folders from the containter to the mapped drive location:
docker cp MS-SQL-Server:/var/opt/mssql/data /mnt/user/appdata/mssql/
docker cp MS-SQL-Server:/var/opt/mssql/secrets /mnt/user/appdata/mssql/
docker cp MS-SQL-Server:/var/opt/mssql/log /mnt/user/appdata/mssql/

3.
Shut down the MSSQL container:

4.
Add these mappings to the MSSQL2019 container template:
/mnt/user/appdata/mssql/data
/mnt/user/appdata/mssql/secrets 
/mnt/user/appdata/mssql/log

5.
Change the permssions on the folders and files:
sudo chown -R 10001 /mnt/user/appdata/mssql/

6.
Start up the MSSQL2019 container

Web capture_29-12-2021_184651_tower.local.jpeg

Edited by newmember
  • Thanks 1
Link to comment
  • 11 months later...

Is anyone, who was previously interacting with this thread, stil on this?

I'm in the process of seting up Bitwarden on UnRaid and I'm not quite sure *how* to do it properly. Given this thread had a lot of the same crosspoints, It may makes sense to ask?:D

Also: Do I really need to run a MSSQL Databse for Bitwarden or is it doing it by itself?

Thanks in advance

Link to comment
6 hours ago, deltaexray said:

Is anyone, who was previously interacting with this thread, stil on this?

I'm in the process of seting up Bitwarden on UnRaid and I'm not quite sure *how* to do it properly. Given this thread had a lot of the same crosspoints, It may makes sense to ask?:D

Also: Do I really need to run a MSSQL Databse for Bitwarden or is it doing it by itself?

Thanks in advance

I think I still have Bitwarden running using the override file specified in my comment:

I don’t recall touching that since and it had been working very well for me.

You cannot choose another SQL version, this is what the template from Bitwarden pulls for you.

 

Good luck!

Link to comment

But speaking of putting in the work: I'm not stupid, like I can handle my fair share of work. But, how did you all got Bitwarden to run on Unraid? Like with docker Compose in a docker, or on a VM or how did you do it?

Because, for me, I cannot get it setup or find a way to do it for me, that in one way or another works. Like I'd like to not run a VM but then, how does Bitwarden run on a system it's not supporting?
I'm a bit out of my "I know what to do" zone here so if anyone as a starting point, I'd be more than gratefull for it.

Maybe I am just thinking to comlicated again but yeah, that's the state.

Thanks :)

Link to comment
13 hours ago, deltaexray said:

But speaking of putting in the work: I'm not stupid, like I can handle my fair share of work. But, how did you all got Bitwarden to run on Unraid? Like with docker Compose in a docker, or on a VM or how did you do it?

Because, for me, I cannot get it setup or find a way to do it for me, that in one way or another works. Like I'd like to not run a VM but then, how does Bitwarden run on a system it's not supporting?
I'm a bit out of my "I know what to do" zone here so if anyone as a starting point, I'd be more than gratefull for it.

Maybe I am just thinking to comlicated again but yeah, that's the state.

Thanks :)

 

You need to find the nerdpack plugin, it has docker-compose included, cause you are right indeed that bitwarden uses docker-compose to start everything up.

Then with that installed just follow the steps mentioned in the Bitwarden docs.

You have to complete:

- step 1

- step 2 is already done by running unraid (docker onboard) and installing the nerdpack for docker-compose

- create a directory in step 3 (I have mine on /mnt/user/appdata/bitwarden since the appdata resides on the cache only). Note that I did not create a bitwarden user at the time, may do that later for additional security, this has been running for 3 years+ lol.

- Get your key in step 4

- Install Bitwarden in step 5 by curling the build script into the directory you have created and then invoke some commands.

- Add the overrides I gave you in the mentioned post in step 6 so it will actually be able to start on unRAID

- Then start it and enjoy Bitwarden.

 

GL!

Edited by S1dney
Link to comment
8 minutes ago, deltaexray said:

So basically, All I have to do is compose my bitwarden docker and get it to run and do not tinker with any MSSQL Installation, given that Bitwarden does install that itself, right?

 

 

You don't really need to compose a docker neither.

Just download/curl the build script, run the commands and when you run ./bitwarden.sh start it will issue the compose commands needed to start anything.
And the override setting will allow you to override the default settings.

Link to comment
5 minutes ago, S1dney said:

You don't really need to compose a docker neither.

Just download/curl the build script, run the commands and when you run ./bitwarden.sh start it will issue the compose commands needed to start anything.
And the override setting will allow you to override the default settings.

Reading this, I get the feeling I need to do everything in the Terminal of Unraid, right? Lile I get the whole picture but I somewhat do not understand where to put all of this? *InsertHeadscratching*
I always thought Unraid is a purly U can only install what there is OS, not something I can go deeper with if you get what I mean.
 

Link to comment
8 minutes ago, deltaexray said:

Reading this, I get the feeling I need to do everything in the Terminal of Unraid, right? Lile I get the whole picture but I somewhat do not understand where to put all of this? *InsertHeadscratching*
I always thought Unraid is a purly U can only install what there is OS, not something I can go deeper with if you get what I mean.
 

No, you will indeed do a lot of this from the terminal as you can't interact from the unRAID dockerman (GUI).

And you can go as deep as you want with unRAID, it doen't really hide anything for you, which is what I love about it.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.