2、docker映象操作

陈奕桦發表於2024-03-20
#列出本地映象
->docker images
 
#拉取映象
->docker pull registry:2.4.1
 
#刪除映象
->docker rmi registry:2.4.1
 
#匯出映象
->docker save -o jenkins.tar.gz jenkins/jenkins
 
#匯入映象
->docker load -i jenkins.tar.gz
 
#修改本地映象
->docker run -t -i registry:2.4.1 /bin/bash
->[執行修改命令]
->exit
->docker commit -m "[註釋]" -a "[作者]" 0b2616b0e5a8 registry:[my-tag]
 
#利用Dokerfile來修改本地映象
->mkdir ./my-registry
->cd ./my-registry
-> vim ./Dockerfile
#編輯Dockerfile內容
FROM registry:2.4.1
MAINTAINER cyh <cyh@docker.com>
RUN echo 'hello word!'
->docker build -t="cyh/registry:2.4.1" ./
 
 
docker build -t jdk8:141 . -f jdk8-dockerfile
 
docker build -t jdk8-2:141 . -f jdk8-dockerfile

相關文章