##初探在容器上构建持续部署( 八 )


[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout)
[Pipeline] container
[Pipeline] {
[Pipeline] sh
echo get source from github
get source from github
[Pipeline] git
No credentials specified
Cloning the remote Git repository
Cloning repository https://github.com/jfeng45/k8sdemo
> git init /home/jenkins/workspace/jenkins-k8sdemo # timeout=10
Fetching upstream changes from https://github.com/jfeng45/k8sdemo
> git --version # timeout=10
> git fetch --tags --force --progress -- https://github.com/jfeng45/k8sdemo refs/heads/*:refs/remotes/origin/*
> git config remote.origin.url https://github.com/jfeng45/k8sdemo # timeout=10
> git config --add remote.origin.fetch refs/heads/*:refs/remotes/origin/* # timeout=10
> git config remote.origin.url https://github.com/jfeng45/k8sdemo # timeout=10
Fetching upstream changes from https://github.com/jfeng45/k8sdemo
> git fetch --tags --force --progress -- https://github.com/jfeng45/k8sdemo refs/heads/*:refs/remotes/origin/*
Checking out Revision 90c57dcd8ff362d01631a54125129090b503364b (refs/remotes/origin/master)
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f 90c57dcd8ff362d01631a54125129090b503364b
> git branch -a -v --no-abbrev # timeout=10
> git checkout -b master 90c57dcd8ff362d01631a54125129090b503364b
Commit message: ''added jenkins continous deployment files''
[Pipeline] }
> git rev-list --no-walk 90c57dcd8ff362d01631a54125129090b503364b # timeout=10
[Pipeline] // container
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build image)
[Pipeline] container
[Pipeline] {
[Pipeline] withCredentials
Masking supported pattern matches of $DOCKER_HUB_USER or $DOCKER_HUB_PASSWORD
[Pipeline] {
[Pipeline] sh
docker login -u **** -p ****
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /home/jenkins/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
docker build -f /home/jenkins/workspace/jenkins-k8sdemo/script/kubernetes/backend/docker/Dockerfile-k8sdemo-backend -t ****/jenkins-k8sdemo:7 .
Sending build context to Docker daemon 218.6kB
Step 1/13 : FROM golang:latest as builder
---> dc7582e06f8e
Step 2/13 : WORKDIR /app
---> Running in c5770704333e
Removing intermediate container c5770704333e
---> 73445078c82d
Step 3/13 : COPY go.mod go.sum ./
---> 6762344c7bc8
Step 4/13 : RUN go mod download
---> Running in 56a1f253c3f5