iT邦幫忙

2019 iT 邦幫忙鐵人賽

DAY 2
0
自我挑戰組

Go to 放棄系列 第 2

Ubuntu進駐樹莓派.並跳起samba

安裝ubuntu

先用docker搜尋ubuntu

docker search ubuntu

再來pull ubuntu下來

docker pull ubuntu

run ubuntu的container

docker run ubuntu

下這行指令去看目前已下載到樹莓派的images

docker images

可以看到已存在ubuntu的image
https://ithelp.ithome.com.tw/upload/images/20181017/201124776KzZhOlTvv.png

進入ubuntu container~

docker run -it ubuntu

這時如果看到你的command prompt不是你的樹莓派帳號.就代表你成功進入容器囉!!
https://ithelp.ithome.com.tw/upload/images/20181017/20112477AEUZOs4Q45.png

此時你也是這個ubuntu最高權限者root了,不用再下sudo去開啟高權限的命令

但我常常粗線條狀態,不確定是否現在操作的事ubuntu的環境
此時下個command

cat /etc/issue.net

https://ithelp.ithome.com.tw/upload/images/20181017/20112477YnNYdXdYcf.png
摁摁~真的數ubuntu,而且還是18.04版~
當然,如果你想確定樹莓派原本的作業系統是否安好,只要下

exit

即可離開ubuntu容器

為何要跳起samba

samba類似windows的網路芳鄰,可以把檔案share出去
會用它的動機,是因為想用mac的環境開編輯器去寫code
所以需要跳起samba拿到存在pi的code,然後保持初衷,不讓mac“污染”

首先再次進入ubuntu container

docker run -it ubuntu

先更新一下application清單

apt-get update

再install samba

apt-get install samba

安裝好,編輯samba的設定檔

vim /etc/samba/smb.conf

結果出現bash: vi: command not found docker
啊呀,看來再container沒有預設編輯神器
所以來安裝這個linux的編輯神器

apt-get install vim

安裝好後大方的編輯

好吧...安裝samba目前卡關,明日再解決!!

備忘錄

列出所有容器,包含終止運行的容器

docker container ls --all

重啟container

docker start {containerID}

use ifconfig command line in docker at first time

apt-get update
apt-get install net-tools

上一篇
為何要使用go,但要參見樹莓派呢?
下一篇
再次跳起samba
系列文
Go to 放棄30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言