修改镜像仓库配置
Former-commit-id: ec6172833842042d3d17c04462781730def61af3
This commit is contained in:
parent
1f15bad31b
commit
3795fc64aa
|
@ -40,7 +40,8 @@ type Config struct {
|
||||||
Endpoint string
|
Endpoint string
|
||||||
}
|
}
|
||||||
|
|
||||||
DockerConf struct {
|
RegistryConf struct {
|
||||||
Host string
|
Username string
|
||||||
|
Password string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,15 +164,15 @@ func pushImage(svcCtx *svc.ServiceContext, hash string, name string) error {
|
||||||
}
|
}
|
||||||
// 推送镜像到registry
|
// 推送镜像到registry
|
||||||
authConfig := types2.AuthConfig{
|
authConfig := types2.AuthConfig{
|
||||||
Username: "jointcloudNudt",
|
Username: svcCtx.Config.RegistryConf.Username,
|
||||||
Password: "Nudt@123",
|
Password: svcCtx.Config.RegistryConf.Password,
|
||||||
}
|
}
|
||||||
authConfigBytes, err := json.Marshal(authConfig)
|
authConfigBytes, err := json.Marshal(authConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
println(fmt.Sprintln("传输开始", time.Now()))
|
logx.Infof(fmt.Sprintln("传输开始", time.Now()))
|
||||||
authStr := base64.URLEncoding.EncodeToString(authConfigBytes)
|
authStr := base64.URLEncoding.EncodeToString(authConfigBytes)
|
||||||
pushBody, err := svcCtx.DockerClient.ImagePush(context.Background(), privateImageName, types2.ImagePushOptions{RegistryAuth: authStr})
|
pushBody, err := svcCtx.DockerClient.ImagePush(context.Background(), privateImageName, types2.ImagePushOptions{RegistryAuth: authStr})
|
||||||
pushBytes, _ := ioutil.ReadAll(pushBody)
|
pushBytes, _ := ioutil.ReadAll(pushBody)
|
||||||
|
|
Loading…
Reference in New Issue