Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"docker container run" requires at least 1 argument

I'm trying to create a container using a volume that I have already created, but my console shows the error

docker container run" requires at least 1 argument

This is the command I'm trying to run:

docker container run --name db -v volume-dados-do-banco:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=Mypass

I have also tried this one, wih more arguments, but the same error persists:

docker container run -d --name db -p 3306:3306 -e 'ACCEPT_EULA=Y' -e MYSQL_ROOT_PASSWORD=Mypass -v volume-dados-do-banco:/var/lib/mysql

Any thoughts on the reason why this is happening?

like image 686
Pedro Coelho Avatar asked May 25 '19 20:05

Pedro Coelho


People also ask

What is required to run a Docker container?

To run an image inside of a container, we use the docker run command. The docker run command requires one parameter and that is the image name. Let's start our image and make sure it is running correctly. Execute the following command in your terminal.

What is the minimum requirement for Docker?

Docker Desktop for Windows requires Windows 10 (Professional, Business, Educational, and Home versions), 64-bit processing, 4GB system RAM, Windows Hyper-V and Container features, and BIOS-level hardware virtualization.

Does Docker limit CPU usage?

CPU. By default, each container's access to the host machine's CPU cycles is unlimited. You can set various constraints to limit a given container's access to the host machine's CPU cycles.


1 Answers

Problem is not with docker, you just didn't specify which image to run. Your command should include Docker image as per documentation.

docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]

Example would be:

docker run -d --name db -v volume-dados-do-banco:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=Mypass mysql:latest
like image 185
Nemanja Ranković Avatar answered Sep 18 '22 11:09

Nemanja Ranković