欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

我的docker常用命令

程序员文章站 2022-03-12 16:57:44
...
#查看版本
[[email protected] ~]# docker version

#查看docker更多信息
[[email protected] ~]# docker info

#看镜像
[[email protected] ~]# docker images 
REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
menglingzhi/new-api-gateway   2.0.3               342660e7c6c5        About an hour ago   283MB
smart/new-api-gateway         2.0.3               342660e7c6c5        About an hour ago   283MB
smart/new-api-gateway         latest              342660e7c6c5        About an hour ago   283MB
openjdk                       8-jdk-alpine        a3562aa0b991        16 months ago       105MB

[[email protected] ~]# docker tag smart/new-api-gateway menglingzhi/new-api-gateway:2.0.3

#运行镜像
[[email protected] ~]# docker run -itd smart/new-api-gateway:latest


#看运行的镜像
[[email protected] ~]# docker ps
CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS               NAMES
0573ed9ebead        smart/new-api-gateway:latest   "sh -c 'java $JAVA_O…"   32 minutes ago      Up 32 minutes                           dreamy_bouman
ae5f9c044ad0        499734f11656                   "/bin/sh"                About an hour ago   Up About an hour                        wonderful_gagarin
3ceb7b58148b        a3562aa0b991                   "/bin/sh"                2 hours ago         Up 2 hours                              modest_margulis

[[email protected] ~]# docker exec -it wonderful_gagarin /bin/sh

#提交到dockerhub
[[email protected] ~]# docker login
[[email protected] ~]# docker push menglingzhi/new-api-gateway:2.0.3