Linux server specifies the packet generation image jar

Use of maven upload 1. Before the mirror from the machine to the server, the uploaded directly to the service package jar, then generates image according to each jar package.

After upload, create Dockerfile file in the same directory

touch Dockerfile

 

2.Dockerfile file contents

FROM refers to the java version you want to use. (Do not modify)

ADD jar which refers to the need to use packaged mirror. (Modified according to the name of the jar package)

EXPOSE refers to the file port number. (The port number modification packet jar)

If the current mirror means ENTRYPOINT started in a container, the command execution. (Do not modify)

 

3. Generate a mirroring

docker build -t xxx . 

xxx, image name

Special attention can be omitted after the dot

Guess you like

Origin www.cnblogs.com/shiblog/p/11711808.html