Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Google ContainerTools Container to build docker Image

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to use Google ContainerTools containers to build docker images". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Plug-in configuration com.google.cloud.tools jib-maven-plugin 0.9.11 xxx.cn-xxx.xxx.com/keking/jdk:1.8 xx@xxx-group Xxx#xx xxx.cn-xxx.xxx.com/keking/kk-businesscard:v1.1 xxx@xxx-group Xxx#xxx cn.keking.kkbusinesscard.Application configuration details

From: define the basic image. The jre image of the private repository configured here

Auth: warehouse authentication user and password configuration

To: target image

Container: relevant configurations in the container, such as spring boot project main method, jvm parameters, etc.

Plug-in command usin

Mvn compile jib:buildTar: this command mirrors the build to disk / targer/jib-image.tar, which can be loaded into docker using docker load-- input target / jib-image.tar

Mvn compile jib:dockerBuild: building an image

Mvn compile jib:build: build an image and push it to the image repository

Mvn compile jib:exportDockerContext: the following figure exports the context needed for docker build to the target/jib-docker-context directory, which can be built using docker build-t myimage my/docker/context/

Integrated plug-in life cycle

Add the following to the plug-in, bind to the package phase and use mvn package to build

This is the end of package build's "how to use the Google ContainerTools container to build a docker image". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report