Previously, on Ubuntu 16.04 I was able to create an image using the following command:
docker run -v /opt/docker/volumes/mssql:/var/opt/mssql \
--name=mssql -I \
-e ACCEPT_EULA=Y -e SA_PASSWORD=Password23 \
-p 1433:1433 \
-d microsoft/mssql-server-linux:2017-latest
When I attempt something similar on macOS High Sierra (10.13) using Docker Community Edition (Version 17.09.0-ce-mac33 (19543), Channel: stable) the container starts and immediately stops with the following.
# Make the container
docker run -v /Users/jeremiah/docker/volumes/mssql:/var/opt/mssql --name=mssql-test -i -e ACCEPT_EULA=Y -e SA_PASSWORD=Password23 -p 1433:1433 -d microsoft/mssql-server-linux:2017-latest
# look at the logs
docker logs mssql-test
2017-10-03 13:46:27.83 Server Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64)
Aug 22 2017 17:04:49
Copyright (C) 2017 Microsoft Corporation
Developer Edition (64-bit) on Linux (Ubuntu 16.04.3 LTS)
2017-10-03 13:46:27.83 Server UTC adjustment: 0:00
2017-10-03 13:46:27.83 Server (c) Microsoft Corporation.
2017-10-03 13:46:27.83 Server All rights reserved.
2017-10-03 13:46:27.83 Server Server process ID is 4116.
2017-10-03 13:46:27.83 Server Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.
2017-10-03 13:46:27.83 Server Registry startup parameters:
-d /var/opt/mssql/data/master.mdf
-l /var/opt/mssql/data/mastlog.ldf
-e /var/opt/mssql/log/errorlog
2017-10-03 13:46:27.85 Server Error: 17113, Severity: 16, State: 1.
2017-10-03 13:46:27.85 Server Error 87(The parameter is incorrect.) occurred while opening file '/var/opt/mssql/data/master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary.
Is there a way to create containers on macOS using a mounted volume instead of a named volume?
Unfortunately, no, not right now. See this previous issue which is still open.
https://github.com/Microsoft/mssql-docker/issues/12
Closing this one as dupe.