-
Notifications
You must be signed in to change notification settings - Fork 747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL-Server 2019 docker container fails to start with -v option #615
Comments
Solved, don't know which one of the following did the trick Maybe it would have sufficed to just chgrp -R 0 /var/opt/mssql_2019
from dockerfile excerpt in |
Maybe it either should check if the user already exists, or it should create a separate user for every mssql-version. Don't know if the docker stuff uses the id or the username for permisson. |
Had to do this three times now because of permissions. |
I have this issue in k8s. :((
|
Problem has been resolve with running this command in the host: |
I had the same problem, I solved it in the following way. my docker compose was has follows
and the change that applies was the following
finally this worked |
There are few solution for this problem: 1. Run docker as root.eg. compose: version: '3.6'
services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
user: root
ports:
- 1433:1433
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=BLAH
volumes:
- ./data:/var/opt/mssql/data Source: #13 (comment) 2. Setup proper directory owner (mssql)
Source in spanish: https://www.eiximenis.dev/posts/2020-06-26-sql-server-docker-no-se-ejecuta-en-root/ 3. Full access (not recommended)Give full access to db files on host |
And, when I change the mapping to This container is running as user mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
2021-01-15 23:50:05.95 Server Setup step is copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'.
2021-01-15 23:50:06.05 Server ERROR: Setup FAILED copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf': 2(The system cannot find the file specified.)
ERROR: BootstrapSystemDataDirectories() failure (HRESULT 0x80070002) Why is an |
For Kubernetes: Adding the SecurityContext also works |
What about rather running as another user? I cannot get this to work.
|
@IoTPlay only the user mssql is supported to run SQL Server on Linux. See this sample for example: https://github.com/microsoft/mssql-docker/blob/master/linux/preview/SLES/dockerfile |
it saved my time. Thanks |
In my case this error happened because the OS drive was full. Somehow this error occurred because of that. |
Did the trick for me :-) |
My docker compose. Running on Macos with m1 processor ✅
|
This works for me! |
I'd recommend anyone facing this issue take a look at the following Microsoft documentation: Take a look at the "Configure persistent storage permissions for non-root containers" section. |
When running with podman on RHEL 9 with selinux enabled, this is what fixed the problem for me:
|
Resolved the issue for me. |
This solution fixed for me |
For me it helped by setting the user:root Part of my docker-compose services: |
For Docker Desktop, WSL2 and docker volumes the solution is:
|
I ran into this using docker volumes, and didn't want to run mssql as root. where I can't easily chown. This is what I ended up with: version: "3.7"
services:
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
restart: always # keep trying, fix-perms might fix mssql
environment:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "<password>"
volumes:
- "mssql-data:/var/opt/mssql/data"
# mssql has some weird defaults around permissions; fixup the volume to match
fix-perms:
image: mcr.microsoft.com/mssql/server:2022-latest
user: root
command: chown -R mssql:root /var/opt/mssql
volumes:
- "mssql-data:/var/opt/mssql/data"
volumes:
mssql-data: |
I'm trying to run SQL-Server 2019 in docker in Ubuntu 18.04.
This is how I want it to look:
I issue the command, and sql-server exits immediately, not even an entry in the logfile in /var/opt/mssql_2019, hell, not even a file created there.
If I omit
-v /var/opt/mssql_2019:/var/opt/mssql
then it works fine.
Doing exactly the same with sql-server 2017 worked fine.
I run
docker logs <containterID>
and I getI set permisson on /var/opt/mssql_2019 for group mssql to read&write...
Am I doing something wrong here, or is this a bug ?
If this is a permission issue, how can I get the container to run as root ?
If I switch to
su mssql
, I can create and delete files and folders in /var/opt/mssql_2019 without problems.Also, if I add user mssql to sudo
adduser mssql sudo
that doesn't help.
It should be noted that the docker file says
but on my computer, user mssql already exists as user 999...
Probably added by sql-server 2017...
The text was updated successfully, but these errors were encountered: