- Hands-On Kubernetes on Windows
- Piotr Tylenda
- 147字
- 2021-06-24 16:54:06
Image tagging and versioning
Docker images use tags in order to provide different versions of the same image in the repository – each image tag corresponds to a given Docker image ID. Specifying tags for Docker images is often performed during an image build, but you can also add tags explicitly using the docker tag command:
docker pull mcr.microsoft.com/dotnet/core/sdk
docker tag mcr.microsoft.com/dotnet/core/sdk:latest mydotnetsdk:v1
docker tag mcr.microsoft.com/dotnet/core/sdk:latest mydotnetsdk:v2
In this example, we pulled the latest image tag (as it was not specified explicitly) of the .NET Core SDK and then tagged the image with the mydotnetsdk:v1 and mydotnetsdk:v2 tags in the local image cache. Now, it is possible to use these tags while performing operations on your local machine, like so:
docker run -it --rm mydotnetsdk:v1
Let's take a look at the latest tag, which is often used when working with Docker.
推薦閱讀
- Spring技術內幕:深入解析Spring架構與設計
- Scratch真好玩:教小孩學編程
- Visual C++串口通信技術詳解(第2版)
- 零基礎學Java(第4版)
- 人人都是網站分析師:從分析師的視角理解網站和解讀數據
- Java項目實戰精編
- 深入淺出Serverless:技術原理與應用實踐
- Python編程:從入門到實踐
- 深入理解Android:Wi-Fi、NFC和GPS卷
- Java系統化項目開發教程
- 基于ARM Cortex-M4F內核的MSP432 MCU開發實踐
- ASP.NET程序開發范例寶典
- JavaScript程序設計(第2版)
- 30天學通C#項目案例開發
- 深度實踐KVM:核心技術、管理運維、性能優化與項目實施