docker 安裝以及配置

?? official docker ??
or ?? website: ?? https://docs.docker.com/mac/

""Index""

Start

Step1: write a docker file

Step 2: Build an image from your Dockerfile

learn about the build process

Start

?? docker as the image or container to get and load the image from the internet or local, then save them into the docker in the docker.
?? for me, it is the database for image :P

?? My laptop is: ?? Mac air -- OS X EL Capitan -- Version 10.11.4

official website

If you see this picture, that means you are on the right track
If you are the other version or other system, please ??? click the orange text for "Linux" and "Windows" on the web

just click continue

Then install the program and ??? click "continue" and then ??? click "finish"

Click Terminal

Once you finish the installation, find your launchpad or open the "Finder" then find this image from the "application"
??? click the left whale terminal "Docker quic...art Terminal"

memeda ??

As this window is open, if you didn't see the text above, please wait a min (or more than a minute) ?? whale may takes some time to pass by your laptop
?? 疮鲫。。 ?? 。飞醉。 ?? 奴愉。竖伯。 ?? 灵嫌。锋华。 ?? 铭污。恋日。 ?? 膀篮。。

finish

See? the whale is coming :) ??

?? enter the code below:
docker run hello-world

?? docker run hello-world

?? try again:P

docker run hello-world
let us start!

Learn about the image and Container:

docker run hello-world 

? docker: name of the program
? run: sub-comment; create and run the system "docker"
? hello-world: tell docker which image you prefer to put into the containers

https://docs.docker.com/engine/userguide/

?? user guide


?? hub

??? find the search from the right top on the page

hub
Here is the box you need find
whalesay

?? enter the text below on the search box as above then ??? click enter/return
whalesay

resource page

link

Find this row and select it
https://hub.docker.com/r/docker/whalesay/

From this page, you can find the way to help you load the image from the docker, there are thousands of images on the docker include some large company such as IBM, Google and other else. As you enter the web page, for example the whalesay, you can see the "how to use this image" for helping using the image in the terminal

so...
here is the code you need to enter to get the whalesay image (i am really confused what the expression the whale will say, let us take a look by enter the below code first ?? )

$ means the start on the terminal, you don't need to enter it within the terminal, if you see in the other place. In here, i prefer delete it and give you the code you need to enter in the code mode.

docker run docker/whalesay cowsay boo
whale say !!

Here is what the terminal display after the "docker run docker/whalesay cowsay boo"

oh, actually, you can see the boo on the left top which is different from the whale before...

..... it says:"boo"!!


Now, we try to see what kinds of images we have so far in our own containers:

docker images
docker images

There is two packages of images in the docker in your local, after we making sure that the ?? "whalesay" package

docker run docker/whalesay cowsay boo-boo
boo

?? whale now is your guest and say boo to you


Step1: write a docker file

  • open the whale terminal and let us start ??

    mkdir mydockerbuild
    

mkdir (make directory): create a new directory

cd mydockerbuild
  • open the new created directory, cd means open in the terminal as you seen before (cheatsheet is on the bottom of the page )
touch Dockerfile

create a Dockerfile in the directory

ls Dockerfile

read the Dockerfile

 open -e Dockerfile

There is another window coming out, here is the text file you can enter the text

text file window

Type the text below in the text file :

  FROM docker/whalesay:latest
  • FROM: the keyword to tell where does the image coming from and execute the action the image after from
enter the text
RUN apt-get -y update && apt-get install -y fortunes

CMD /user/games/fortune -a | cowsay
whole text

then use the File>save or command -S to save the file

run in terminal

As you run in the terminal, you can see the text was shown.

Step 2: Build an image from your Dockerfile

cat Dockerfile

cat: it is not the cat ?? , but the action of "CATCH" miao~~

docker build -t docker-whale .
successful built

learn about the build process

docker build -t docker-whale .
docker build

https://docs.docker.com/mac/step_four/


Extra resources:

  1. terminal cheat sheet
terminal.png
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末岂膳,一起剝皮案震驚了整個(gè)濱河市誓竿,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌谈截,老刑警劉巖筷屡,帶你破解...
    沈念sama閱讀 216,591評(píng)論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異簸喂,居然都是意外死亡毙死,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,448評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門喻鳄,熙熙樓的掌柜王于貴愁眉苦臉地迎上來扼倘,“玉大人,你說我怎么就攤上這事除呵≡倬眨” “怎么了?”我有些...
    開封第一講書人閱讀 162,823評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵颜曾,是天一觀的道長(zhǎng)袄简。 經(jīng)常有香客問我,道長(zhǎng)泛啸,這世上最難降的妖魔是什么绿语? 我笑而不...
    開封第一講書人閱讀 58,204評(píng)論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮候址,結(jié)果婚禮上吕粹,老公的妹妹穿的比我還像新娘。我一直安慰自己岗仑,他們只是感情好匹耕,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,228評(píng)論 6 388
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著荠雕,像睡著了一般稳其。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上炸卑,一...
    開封第一講書人閱讀 51,190評(píng)論 1 299
  • 那天既鞠,我揣著相機(jī)與錄音,去河邊找鬼盖文。 笑死嘱蛋,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播洒敏,決...
    沈念sama閱讀 40,078評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼龄恋,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了凶伙?” 一聲冷哼從身側(cè)響起郭毕,我...
    開封第一講書人閱讀 38,923評(píng)論 0 274
  • 序言:老撾萬榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎函荣,沒想到半個(gè)月后铣卡,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,334評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡偏竟,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,550評(píng)論 2 333
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了敞峭。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片踊谋。...
    茶點(diǎn)故事閱讀 39,727評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖旋讹,靈堂內(nèi)的尸體忽然破棺而出殖蚕,到底是詐尸還是另有隱情,我是刑警寧澤沉迹,帶...
    沈念sama閱讀 35,428評(píng)論 5 343
  • 正文 年R本政府宣布睦疫,位于F島的核電站,受9級(jí)特大地震影響鞭呕,放射性物質(zhì)發(fā)生泄漏蛤育。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,022評(píng)論 3 326
  • 文/蒙蒙 一葫松、第九天 我趴在偏房一處隱蔽的房頂上張望瓦糕。 院中可真熱鬧,春花似錦腋么、人聲如沸咕娄。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,672評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽圣勒。三九已至,卻和暖如春摧扇,著一層夾襖步出監(jiān)牢的瞬間圣贸,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,826評(píng)論 1 269
  • 我被黑心中介騙來泰國(guó)打工扛稽, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留旁趟,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 47,734評(píng)論 2 368
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像锡搜,于是被迫代替她去往敵國(guó)和親橙困。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,619評(píng)論 2 354

推薦閱讀更多精彩內(nèi)容