Docker Run options

OptionDescriptionExample
-iEnable Inputdocker run -it ubuntu bash
-tClean output docker run -it ubuntu bash
-pSet port host and containerdocker run -p 80:8080
-vMount host filesystem into containerdocker run -it -v ~/Desktop/mounted_folder:/new_dir ubuntu bash
-ePass environment variables to Docker containerdocker run -it -e “SPRING_PROFILES_ACTIVE=prod”

-e XXX=” \
-e YYY=”
-dDetach after container start(run background)docker run -it -d ubuntu bash
–rmRemove container after Exit (one time container)docker run –rm hello-world
–cpusSet number of CPUSdocker run –cpus 4
–memorySet memorydocker run –memory 2g
未分類
スポンサーリンク
Professional Programmer2

コメント