在Windows 10上安裝`vagrant`,以及在虛擬機中安裝`docker` === ## 在Windows 10的環境安裝(使用VM) https://hackmd.io/@joshhu/HkBgfl8DB ## 示範在公網IP上實作`apache`使用`docker` ### 直接執行`docker` ```shell= docker run -d -p 80:80 tutum/apache-php ``` http://120.105.96.9 ### 修改網頁內容 ```shell= docker exec -it <container id> bash ``` 進入container之後 ```shell= cd /app vi index.php ``` 將`hello world`改成`hello MUST` http://120.105.96.9 ## 在虛擬機中執行docker ### 安裝`vagrant` 1. 確定主機已經有安裝Virtual Box 2. https://releases.hashicorp.com/vagrant/2.2.18/vagrant_2.2.18_x86_64.msi 3. 直接安裝即可 4. 重新啟動電腦 ### 建立一台`ububtu 20.04`的虛擬機 1. 進入Windows Power Shell 2. 安裝外掛`vagrant plugin install vagrant-vbguest` 3. 檢視外掛`vagrant plugin list` 4. 更新外掛`vagrant plugin update` 5. 輸入`vagrant init ubuntu/focal64` 6. 更新虛擬機映像檔`vagrant box update`
×
Sign in
Email
Password
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