🎯開發工具
請參考下圖
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
設定使用資源
NOTE:如果出現紅框1說明,請從 Disk image location 新增 WSL2 設定檔,反之,直接使用 slider bar 調整即可
You are using the WSL 2 backend, so resource limits are managed by Windows.
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Disk image location 新增 WSL2 設定檔
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
.wslconfig,可在 WSL 2 上執行的所有已安裝散發套件全域設定設定。
複製以下設定,安裝 WSL2 行2 不需修改,
memory 記憶體,請依自己機器資源調整,建議值 virtual processors * 2
processors 處理器,請依自己機器資源調整,此範例為 2個虛擬處理器
筆記作者的設定值為 processors=2, memory=4GB 請依自己需求設定資源
開啟 VS2022 新增 api 空白專案
勾選「啟用 Docker」,選擇 Docker OS 「Linux」,按下「建立」
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
開啟命令提示字元 - Lab 1
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
切換目錄至專案資料夾
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
執行 docker build image 指令
存儲庫名稱將為 dockersample 標籤將為 latest 閱讀有關標籤的更多信息
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
確認 docker image - Lab 2
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
建置完成的 docker image 也能在 Docker Desktop 看見
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
建立開發憑證 - Lab 3
清除先前的 SSL 開發證書
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
產生新的 SSL 開發證書 aspnetapp.pfx 請將 aspnetapp 名稱換為你的應用程式名稱
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
檔案會產生在 .aspnet\https 路徑底下,再次確認開發憑證與你的應用程式專案名稱是否一致
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
信任 ASP.NET Core HTTPS 開發證書
Linux/macOS 作業系統,沒有 –trust 參數可用
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
開發證書,可以移至任意目錄存放,只要 docker run 有將開發憑證夾帶至 docker container 即可
作者預設存放目錄位置為:
docker run - Lab 4
執行指令
Options
Name, shorthand |
Default |
Description |
–publish , -p |
|
Publish a container’s port(s) to the host 意指 將容器的端口發佈到主機,8000 主機 Port : 80 容器 Port |
–env , -e |
|
Set environment variables 設置環境變數 |
–volume , -v |
|
Bind mount a volume 綁定掛載的 volume |
完成
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →