下載 Ubuntu Docker Golang

來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。

下載 Ubuntu 教程

  1. 下載地址:http://www.ubuntu.org.cn/download/alternative-downloads。版本為 14.04.4

  2. 配置過程查看收藏網頁

  3. 用 mac iTerm 操作ubuntu:ssh hostname@ip [-p port]
    ssh 預設連接埠是 22
    ssh rainbow@192.169.240.131 串連

  4. 安裝 Docker https://docs.docker.com/engine/installation/linux/ubuntulinux/
    先決條件:

    1. 查看是否有 apt-get ,或者升級: sudo apt-get update

    2. 安裝:sudo apt-get install apt-transport-https ca-certificates

安裝 Docker:

  1. sudo apt-get update

  2. sudo apt-get install docker-engine
    報錯:timeout;原因:翻牆掛了;解決方式:查看步驟3

  3. 用 DAOcloud 接入自有主機:
    curl -sSL https://get.daocloud.io/docker | sh

  4. 退出重新登入

  5. 查看狀態 sudo service docker status,顯示 docker start/running 說明安裝成功

  6. 查看容器 docker ps; 結果:無內容;原因:使用者未在 docker 組內,解決方式:看步驟8

  7. 查看容器 sudo docker ps;結果:root 使用者查看有內容,證實了上述猜測是正確的。

  8. 需要將使用者加入到 docker 組內,sudo usermod -aG docker $USER,再執行 docker ps,此時能夠看到內容。
  9. docker run hello-world
    (把使用者加入 docker 組以後,此處不需要加 sudo) 下載一個 test image
    To generate this message, Docker took the following steps:1. The Docker client contacted the Docker daemon.2. The Docker daemon pulled the "hello-world" image from the Docker Hub.3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.

  10. docker ps -a 查看所有容器內容,由於剛才的 test image 退出了,所以 docker ps 時查看不到。

  11. 下載 golang :https://www.digitalocean.com/community/tutorials/how-to-install-go-1-6-on-ubuntu-14-04

    1. sudo apt-get update

    2. sudo apt-get -y upgrade

    3. sudo curl -O https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz :下載 golang 壓縮包,-O 表示將下載的內容全部放在後面的檔案名稱內。curl 表示擷取後面地址指向的頁面,不管是檔案或者是圖片等都可以下載到本地。

    4. 速度太慢可以用迅雷加後面的 url 下載,然後拷貝到 Ubuntu 內

    5. scp go1.6.darwin-amd64.tar.gz rainbow@192.168.240.131:
      前面表示拷貝的檔案,後面為路徑,冒號用來分隔 IP 和 檔案夾,表示拷貝到使用者rainbow的 home目錄,如果最後是 :/
      表示拷貝到根目錄。

    6. 解壓縮

    7. 移除老版本的 go : sudo apt-get remove golang-go

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.