Common commands for Docker container operation

This article is an introduction.

operation command Explain
Function docker run --name container-name -d image-name
For example: docker run --name myredis – d redis
--Name: Custom container name
-d: Indicates background operation
Image name: Specifies the image name to run
list docker ps (view the running containers); Add - a; all containers can be viewed
Stop it docker stop container-name/container-id Stops the currently running specified container
start-up docker start container-name/container-id Starting container
delete docker rm container-id Delete specified container
Port mapping -p 6379:6379
For example: docker run -- name myredis - d -p 6379:6379

-p: Host ports map to ports inside the container

Container log docker logs container-name/container-id  

Environmental preparation

[root@localhost ~]# docker search tomcat
INDEX       NAME                                            DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED                                Apache Tomcat is an open source implementa...   1980      [OK]                                 Apache TomEE is an all-Apache Java EE cert...   53        [OK]                        Ubuntu 14.04, Oracle JDK 8 and Tomcat 8 ba...   49                   [OK]              Apache Tomcat 7/8 using Oracle Java 7/8 wi...   29                   [OK]                        Bitnami Tomcat Docker Image                     20                   [OK]                     Tomcat 7.0.57, 8080, "admin/admin"              16                   [OK]                     Tomcat server, 6/7/8                            15                   [OK]   a sample spring-boot app using tomcat and ...   10                   [OK]                          Base docker image to run a Tomcat applicat...   10                            Minimal Docker image with Apache Tomcat         8                              Debian, Oracle JDK, Tomcat & MySQL              7                    [OK]                      CentOS , Oracle Java, tomcat application s...   3                    [OK]                          Apache Tomcat is an open source implementa...   2                                   Apache Tomcat is an open source implementa...   2                            Tomcat7 with java8.                             2                                  Tomcat7                                         1                    [OK]             Docker image for tomcat with logback integ...   1                    [OK]                      Fabric8 Tomcat 8 Image                          1                    [OK]                    Apache tomcat 8.5, 8.0, 7.0                     1                    [OK]                  Tomcat Concourse Resource                       0                                                                                  0                                   Testing CI Jobs with different names.           0                                  tomcat7 with jre8 and MANAGER_USER / MANAG...   0                    [OK]                          Apache Tomcat is an open source implementa...   0                   backend tomcat for service-print "the true...   0        
[root@localhost ~]#




Container operation














Keywords: Docker Tomcat Apache Oracle

Added by said_r3000 on Tue, 07 Jan 2020 03:21:38 +0200