Docker container service commands

$ nohup java -jar test.jar >temp.txt &

// This method will log file into the file you specify is not created automatically. The process will run in the background.

springboot project deployment

 

Delete / stop the container:

 

Docker $ PS  // View all running container 
$ Docker STOP containerId // stop containerId is the container ID 
$ Docker PS -a // View all Docker containers PS -a -q $ // View all containers ID 
$ Docker STOP $ ( Docker PS -a -q) //   sTOP to stop all container 
$ Docker RM $ (Docker PS -a -q) //    the Remove to remove all containers

 

docker service restart

systemctl way
 // daemon restart 
sudo systemctl daemon- reload
 // restart docker service 
sudo systemctl restart docker
 // close docker 
sudo systemctl STOP docker

service way
// restart docker service 
sudo Service docker restart
 // close docker 
sudo Service docker STOP

 

docker to create and run a mirror project springboot

docker run -d -p 8080:8080 sprintbootdemo

  • Production dockerfile the mirror
    FROM hub.c.163.com/library/java:latest
    VOLUME /tmp
    ADD target/hros-0.0.1-SNAPSHOT.jar app.jar
    ENTRYPOINT ["java","-jar","/app.jar"]

    FROM representation made with a base image, based on the current jdk mirrors production.

    MAINTAINER represent producer

    COPY said it would copy a file on a server somewhere mirror

    CMD represents a command to be executed when starting a container

    EXPOSE the port after the vessel started opening

  • Perform mirroring command, docker build -t sprinpbootdemo. -F springbootdockerfile
  • Perform mirroring command: -d -p represents a map showing the back-end operation host port and container port, the former said host port, which represents a container port, container port to be consistent and mirroring files, the port is also springboot project ports used docker run -d -p 8080: 8080 sprintbootdemo

 

 

docker run -d --hostname my-rabbit --name rabbit -p 5672:5672 -p 15672:15672 rabbitmq:management

 

python3 installation

Python3 time before installing on linux, in order to allow python2 not affect the original environment of linux environment, the method chosen is to download the corresponding package python linux environment, but

It should be noted that the linux do not change the default input method python2 python entered, the time to do their own installation python3 time to make a soft link python3, otherwise the system depends on a lot of tools python2,

And they are using python2

Here is an example to centos, execute:

yum install python36

Because I use the python3.6 environment here you can put linux to install the latest python3.6.6 by the above command. Then execution

yum install python36-devel

This is to install some dependencies, after the command is completed, the installation is successful python3 environment, but this time you can not enter into the python3 python3 are on linux,

This method is installed by default to the up / down usr / bin / directory, you need to make a soft link

ln -s /usr/bin/python3.6 /usr/bin/python3

The final step is even worse, install pip

python3 -m ensurepip

So far our python3 environment is now installed, with respect to the compiler installation method is still a lot faster, especially when the environment when you need to install on multiple machines python3, and in this way you can quickly batch installation

 

 

 

Guess you like

Origin www.cnblogs.com/liruilong/p/12333286.html