When i push image to private register(harbor):
$ docker push harbor.wxtest.com/public/alpine-delrediskline:3.16.0-3
The push refers to repository [harbor.wxtest.com/public/alpine-delrediskline]
887d6ad1c9d4: Layer already exists
c7c486fce125: Layer already exists
24302eb7d908: Layer already exists
invalid checksum digest format
I tried to delete all images and then push again, the problem still exists.
This is docker info:
$ docker info
Client:
Context: default
Debug Mode: false
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 5
Server Version: 20.10.7
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version:
runc version:
init version:
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 5.11.0-1020-aws
Operating System: Ubuntu 20.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.899GiB
Name: weex-dev-lb
ID: UX3F:6G5F:R67E:54QG:ZQGW:Y2PK:GMFA:SHI6:6EFA:VSDH:KAJP:UIUJ
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
harbor.phzt.weextest.com
10.7.4.53:30002
127.0.0.0/8
Live Restore Enabled: false
$ docker version
Client:
Version: 20.10.7
API version: 1.41
Go version: go1.13.8
Git commit: 20.10.7-0ubuntu5~20.04.2
Built: Mon Nov 1 00:34:17 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.12)
Go version: go1.13.8
Git commit: 20.10.7-0ubuntu5~20.04.2
Built: Fri Oct 22 00:45:53 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.5.9-0ubuntu1~20.04.4
GitCommit:
runc:
Version: 1.0.1-0ubuntu2~20.04.1
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
Below is a simple jenkinsfile:
pipeline {
agent {
node {
label 'go'
}
}
stages {
stage('构建并推送镜像') {
agent none
steps {
sh '''cat > Dockerfile <<EOF
FROM nginx:latest
EOF
'''
container('go') {
sh 'docker build --network host -t harbor.wxtest.com/public/nginx-test:v1adfea .'
withCredentials([usernamePassword(credentialsId : 'harbor-new' ,passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,)]) {
sh 'echo "asdfea342dfFD3" | docker login http://harbor.wxtest.com -u "admin" --password-stdin'
sh 'docker push harbor.wxtest.com/public/nginx-test:v1adfea'
}
}
}
}
}
}
This harbor is installed in Kubernetes through helm, and no certificate is configured; it needs to be used separately from the previous harbor (production environment).
I googled for a long time and didn’t find a similar question, hope someone here can help me.
2
Answers
The error status shown shows that the layer already exists if you have tried to remove all the available images and upload and it still is showing the status.
try creating a new repo and check by pushing the image there so that we can make confirmation about the values we provided by Jenkins file is valid and can be used to push accordingly.
It might be caused by one of the image layers(blob) corrupted in the file system. you could find and delete this blob and try repush