Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use Google ContainerTools Container to build docker Image

Shulou Source: shulou.com Published: 2022-06-01 11:17:43 11月15日 Update

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!

Tags: Mirrors configurations plug-ins containers repositories content commands more knowledge practicality learning next up and down context parameters cycles dilemmas basics actual passwords Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Technology Docker NVidia Xiaomi