Understanding a complex docker command -
i going through tutorial online , author , uses following command along way:
sudo docker run --name my_sql -e mysql_root_password=mysecretpassword --volumes-from my_datastore -d mysql
so understanding of above command follows there specific name given image , after there environment variable being passed , after there --volumens-from
command being executed , -d
indicates container should run in background .
i not sure mysql @ end.
my question following:
docker uses following syntax:
docker [options] command [arg...]
in command have highlighted [options]
command
, [arg...]
? mysql doing in end of command ?
thank you.
alex-z.
great question, , you're correct on statements.
the naming convention follows:
the name of container
--name my_sql
environment variable(s) - can add many want, each additional '-e' directive
-e mysql_root_password=mysecretpassword
directive use volume different container
--volumes-from my_datastore
run in background
-d
the name of docker image you're using make container
mysql
you use mysql:latest (the :latest tag pull recent version of image).
hope helps!
Comments
Post a Comment