本文共 3965 字,大约阅读时间需要 13 分钟。
#escape=\#thie is a DockerfileFROM busyboxENV box /helloENV a1 ${box}_a1ENV a2 $box_a1ENV a3 $boxENV a4 ${box}ENV a5 ${a1:-world}ENV a6 ${a0:-world}ENV a7 ${a1:+world}ENV a8 ${a0:+world}ENV a9 \$boxENV a10 \${box}
[root@localhost df]# docker build -t vker/df:0.1 .Sending build context to Docker daemon 2.048kBStep 1/12 : FROM busybox---> 6ad733544a63Step 2/12 : ENV box /hello---> Running in d02799e03853---> 42ce9cb6ff2dRemoving intermediate container d02799e03853Step 3/12 : ENV a1 ${box}_a1---> Running in 2da6572101ea---> b0c48ad6493fRemoving intermediate container 2da6572101eaStep 4/12 : ENV a2 $box_a1---> Running in ecfcef134413---> 01b1c31bafebRemoving intermediate container ecfcef134413Step 5/12 : ENV a3 $box---> Running in 0b99c236d291---> c23b77d0dc2bRemoving intermediate container 0b99c236d291Step 6/12 : ENV a4 ${box}---> Running in 857f46adaa4b---> 96bc86cb4b4eRemoving intermediate container 857f46adaa4bStep 7/12 : ENV a5 ${a1:-world}---> Running in c2c28de1df9c---> 6b06e0e7e3d2Removing intermediate container c2c28de1df9cStep 8/12 : ENV a6 ${a0:-world}---> Running in d98a96c77096---> 9ee5a36f5cffRemoving intermediate container d98a96c77096Step 9/12 : ENV a7 ${a1:+world}---> Running in cccb508fea54---> 74e8b22013bcRemoving intermediate container cccb508fea54Step 10/12 : ENV a8 ${a0:+world}---> Running in ef18b0a3b373---> 6a58987ed19bRemoving intermediate container ef18b0a3b373Step 11/12 : ENV a9 \$box---> Running in 8b58200ba08e---> 98eb20ae4275Removing intermediate container 8b58200ba08eStep 12/12 : ENV a10 \${box}---> Running in e885b683320e---> 2a25e714317fRemoving intermediate container e885b683320eSuccessfully built 2a25e714317fSuccessfully tagged vker/df:0.1[root@localhost df]# docker run -it vker/df:0.1/ # envHOSTNAME=da1714f4cec7SHLVL=1HOME=/rootTERM=xterma1=/hello_a1PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bina2=a3=/helloa4=/helloa5=/hello_a1box=/helloa6=worlda7=worlda8=a9=$boxa10=${box}PWD=/
#escape=`#thie is a DockerfileFROM busyboxENV box /helloENV a1 ${box}_a1ENV a2 $box_a1ENV a3 $boxENV a4 ${box}ENV a5 ${a1:-world}ENV a6 ${a0:-world}ENV a7 ${a1:+world}ENV a8 ${a0:+world}ENV a9 \$boxENV a10 \${box}
[root@localhost df]# docker build -t vker/df:0.2 .Sending build context to Docker daemon 2.048kBStep 1/12 : FROM busybox---> 6ad733544a63Step 2/12 : ENV box /hello---> Using cache---> 42ce9cb6ff2dStep 3/12 : ENV a1 ${box}_a1---> Using cache---> b0c48ad6493fStep 4/12 : ENV a2 $box_a1---> Using cache---> 01b1c31bafebStep 5/12 : ENV a3 $box---> Using cache---> c23b77d0dc2bStep 6/12 : ENV a4 ${box}---> Using cache---> 96bc86cb4b4eStep 7/12 : ENV a5 ${a1:-world}---> Using cache---> 6b06e0e7e3d2Step 8/12 : ENV a6 ${a0:-world}---> Using cache---> 9ee5a36f5cffStep 9/12 : ENV a7 ${a1:+world}---> Using cache---> 74e8b22013bcStep 10/12 : ENV a8 ${a0:+world}---> Using cache---> 6a58987ed19bStep 11/12 : ENV a9 \$box---> Running in c9e0ec549370---> 580f54c68259Removing intermediate container c9e0ec549370Step 12/12 : ENV a10 \${box}---> Running in 10db56b4ab60---> 9d7e21bc1282Removing intermediate container 10db56b4ab60Successfully built 9d7e21bc1282Successfully tagged vker/df:0.2[root@localhost df]# docker run -it vker/df:0.2/ # envHOSTNAME=2fc25e990f12SHLVL=1HOME=/rootTERM=xterma1=/hello_a1PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bina2=a3=/helloa4=/helloa5=/hello_a1box=/helloa6=worlda7=worlda8=a9=\/helloa10=\/hello
转载地址:http://wjej.baihongyu.com/