Kai Chen
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 六角鼠年鐵人賽 Week 2 - 安裝 Docker ==大家好,我是 "為了拿到金角獎盃而努力著" 的文毅青年 - Kai== ### 聽彈琴 劉長卿 :::info 泠泠七絃上,靜聽松風寒。古調雖自愛,今人多不彈。 ::: ## 安裝 Docker 個人使用的OS是 **Windows 10** 家用版,官方建議的版本要求為 **Windows 10 專業版、企業版、教育版**(須更新到一定版本),方可使用 Docker For Windows 安裝包,未達標的情況只能退而求其次,改用同為 Docker 官方推出的 **Docker Toolbox** [Docker 官方 Docker Toolbox Releases 下載連結](https://github.com/docker/toolbox/releases) 個人下載版本 **DockerToolbox-19.03.1.exe** ==如果介意官方收集你的使用數據或錯誤訊息的話,可以選擇不要打勾== ![](https://i.imgur.com/jr5wsi4.png) ==選擇安裝路徑後,接續是安裝包內容,個人因為有先安裝了Git,就不再重複裝了== ==Kitematic 是一個管理Docker的GUI工具,喜歡視覺化操作的人建議安裝== ![](https://i.imgur.com/UP6OWtq.png) ==繼續最後的設定== ==第一個選項是問你要不要在桌面建立捷徑== ==第二個選項為增加 docker 在系統 Path 路徑中== ==第三個選項為 Boot2Docker,這是在非Linux環境中,用來建構可以執行 Docker 環境的東西== ==第四個為是否安裝為NDIS5(預設為NDIS6),因官方在 Windows Vista 後的版本都是預設為NDIS6,而某些操作可能導致虛擬機速度變慢或網路異常,此時可以重裝 Docker Toolbox 為 NDIS5 應該能夠解決問題 (官方說法)== ==等遇到再說(耶!)== ![](https://i.imgur.com/wlZlQxx.png) ==慢慢安裝中== ![](https://i.imgur.com/KWhgNsQ.png) ==安裝完後跳出 Oracle Corporation 通用序列匯流排控制器,這是要建立 Oracle VM 需要的東西,直接安裝== ![](https://i.imgur.com/Pkpwuk6.png) ==這樣就安裝完成了!== ![](https://i.imgur.com/nwdRnus.png) ==接下來要開啟 Windows 支援的設定,請在 Windows 功能中找到 Containers 和 Hyper-V 這兩個選項,都給勾起來! == ![](https://i.imgur.com/StAw0po.png) ==若遇到 Hyper-V 勾選而導致啟動 Docker 有問題的請再回頭取消掉,這是因為在開啟情況下不支援 64 bits 的關係== ![](https://i.imgur.com/KEgSrW5.png) ==在你的桌面或是開始目錄集裡找到 **Docker Quickstart Terminal**== ![](https://i.imgur.com/L1U7qLJ.png) ==該捷徑其實是去開 Docker Toolbox 資料夾底下的 start.sh== ![](https://i.imgur.com/lmXoDeO.png) ==打開後需要等候一段時間讓 Docker 更新他需要下載或安裝的設定== ![](https://i.imgur.com/Welq8Ts.png) ==當可愛的鯨魚跑出來時,就代表安裝完畢,可以開始使用 Docker 了!== ![](https://i.imgur.com/xx7Qowe.png) ## 簡易操作,確認安裝 ==輸入你的第一行指令,確認是否安裝成功== ``` docker container run hello-world ``` ![](https://i.imgur.com/G8YXhKP.png) ==查看 Docker 版本== ``` docker version ``` ![](https://i.imgur.com/tXVpVjH.png) ==Docker Machine 是Docker的執行環境,可以使用用以下指令查看目前有哪些環境== ``` docker-machine ls ``` ![](https://i.imgur.com/TOFeIjU.png) ==因為我的預設有 default 環境了,若沒有的人可以用以下指令建立== ``` docker-machine create --driver virtualbox default ``` ==查看 Docker machine 的環境設定訊息== ``` docker-machine env [docker-machine 名字] Kai 想看預設環境的指令如下 docker-machine env default ``` ==最下面還有提示使用 eval $("[docker-machine.exe 路徑]" env [docker-machine 名字]) 指令,可以快速設定該 docker-machine 的參數== ![](https://i.imgur.com/czVGqPN.png) ==查看 Docker machine 狀態== ``` docker-machine status [docker machine 名字] Kai 想看預設環境的指令如下 docker-machine status default ``` ![](https://i.imgur.com/9taT5T2.png) ==當然也可以透過指令去執行開啟和關閉 docker machine== ``` 開啟 docker-machine start [docker machine 名字] 關閉 docker-machine stop [docker machine 名字] Kai 對預設環境操作的指令如下 docker-machine start default docker-machine stop default ``` P.S. 在開啟的過程會需要重新取得一個新IP,因此開啟後會有提示訊息說 docker-machine 的環境參數會有所變動,最好還是乖乖查看一下 ![](https://i.imgur.com/gnzAd5x.png) ==最後我們可以利用 SSH 連線到該 docker-machine 的環境中執行未來我們要做的動作== ``` docker-machine ssh [docker machine 名字] Kai 對預設環境操作的指令如下 docker-machine ssh default 如果要離開請用 exit ``` ![](https://i.imgur.com/ssLfX2S.png) ## 結語 :::danger 下篇將會分享 **Docker 重要元素** 的學習心得 [六角鼠年鐵人賽 Week 3 - 介紹 Docker 重要元素](/krSqyvTjRTaNDTyofT-hkQ) ::: 首頁 [Kai 個人技術 Hackmd](/2G-RoB0QTrKzkftH2uLueA) ###### tags: `Docker`,`w3HexSchool`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully