- 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.
推薦閱讀
- 自己動手寫搜索引擎
- Pandas Cookbook
- JavaScript 網頁編程從入門到精通 (清華社"視頻大講堂"大系·網絡開發(fā)視頻大講堂)
- C語言程序設計教程(第2版)
- 實戰(zhàn)低代碼
- 人人都懂設計模式:從生活中領悟設計模式(Python實現(xiàn))
- Java項目實戰(zhàn)精編
- AppInventor實踐教程:Android智能應用開發(fā)前傳
- Learning AngularJS for .NET Developers
- Julia for Data Science
- Learning Splunk Web Framework
- Python+Office:輕松實現(xiàn)Python辦公自動化
- Python一行流:像專家一樣寫代碼
- OpenCV 3.0 Computer Vision with Java
- 軟件測試分析與實踐