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 docker.io/redis

-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
docker.io   docker.io/tomcat                                Apache Tomcat is an open source implementa...   1980      [OK]       
docker.io   docker.io/tomee                                 Apache TomEE is an all-Apache Java EE cert...   53        [OK]       
docker.io   docker.io/dordoka/tomcat                        Ubuntu 14.04, Oracle JDK 8 and Tomcat 8 ba...   49                   [OK]
docker.io   docker.io/davidcaste/alpine-tomcat              Apache Tomcat 7/8 using Oracle Java 7/8 wi...   29                   [OK]
docker.io   docker.io/bitnami/tomcat                        Bitnami Tomcat Docker Image                     20                   [OK]
docker.io   docker.io/consol/tomcat-7.0                     Tomcat 7.0.57, 8080, "admin/admin"              16                   [OK]
docker.io   docker.io/cloudesire/tomcat                     Tomcat server, 6/7/8                            15                   [OK]
docker.io   docker.io/meirwa/spring-boot-tomcat-mysql-app   a sample spring-boot app using tomcat and ...   10                   [OK]
docker.io   docker.io/tutum/tomcat                          Base docker image to run a Tomcat applicat...   10                   
docker.io   docker.io/jeanblanchard/tomcat                  Minimal Docker image with Apache Tomcat         8                    
docker.io   docker.io/aallam/tomcat-mysql                   Debian, Oracle JDK, Tomcat & MySQL              7                    [OK]
docker.io   docker.io/rightctrl/tomcat                      CentOS , Oracle Java, tomcat application s...   3                    [OK]
docker.io   docker.io/amd64/tomcat                          Apache Tomcat is an open source implementa...   2                    
docker.io   docker.io/arm64v8/tomcat                        Apache Tomcat is an open source implementa...   2                    
docker.io   docker.io/maluuba/tomcat7-java8                 Tomcat7 with java8.                             2                    
docker.io   docker.io/99taxis/tomcat7                       Tomcat7                                         1                    [OK]
docker.io   docker.io/camptocamp/tomcat-logback             Docker image for tomcat with logback integ...   1                    [OK]
docker.io   docker.io/fabric8/tomcat-8                      Fabric8 Tomcat 8 Image                          1                    [OK]
docker.io   docker.io/primetoninc/tomcat                    Apache tomcat 8.5, 8.0, 7.0                     1                    [OK]
docker.io   docker.io/cfje/tomcat-resource                  Tomcat Concourse Resource                       0                    
docker.io   docker.io/jelastic/tomcat                                                                       0                    
docker.io   docker.io/oobsri/tomcat8                        Testing CI Jobs with different names.           0                    
docker.io   docker.io/picoded/tomcat7                       tomcat7 with jre8 and MANAGER_USER / MANAG...   0                    [OK]
docker.io   docker.io/s390x/tomcat                          Apache Tomcat is an open source implementa...   0                    
docker.io   docker.io/swisstopo/service-print-tomcat        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