简体   繁体   中英

SQL Server in Docker network: executable file not found in $PATH": unknown

I want to create a Docker network and use it with a SQL Server. Here is what I've done:

# Setup Network
sudo docker network create -d bridge dockerapi-dev

# Setup MSSQL Server
sudo docker pull mcr.microsoft.com/mssql/server
sudo docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=password" -p 1433:1433 -d mcr.microsoft.com/mssql/server --network dockerapi-dev --name mssqlserver

Under sudo docker network ls my network "dockerapi-dev" shows up as "bridge" as I want it to.

With the last command, I get the following error message:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"--network\": executable file not found in $PATH": unknown.

I would be grateful if someone could help me.

The error message is a hint that it thinks --network is part of the image to run.

Re-order your arguments like this (the image to run is last):

sudo docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=password" -p 1433:1433 -d --network dockerapi-dev --name mssqlserver mcr.microsoft.com/mssql/server

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM