docker / docker-credential-helpers

Programs to keep Docker login credentials safe by storing in platform keystores
MIT License
1.05k stars 166 forks source link

sonatype nexus repository manager docker hosted push output no basic auth credentials #301

Open zouchengli opened 8 months ago

zouchengli commented 8 months ago
image
zouchengli commented 8 months ago

devops-agent:~# docker login Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one. Username: zouchengli Password: Login Succeeded

devops-agent:~# docker push zouchengli/javabase:0.8.0 The push refers to repository [docker.io/zouchengli/javabase] dbfb506952bc: Preparing 8a6d769dbc98: Preparing c360e15dce29: Preparing 1e8448e73a9b: Preparing b57c79f4a9f3: Preparing d60e01b37e74: Waiting e45cfbc98a50: Waiting 762d8e1a6054: Waiting denied: requested access to the resource is denied

zouchengli commented 8 months ago

devops-agent:~# docker-credential-pass list {"docker-releases.x.x.com":"x-devops","https://index.docker.io/v1/":"zouchengli"}

zouchengli commented 8 months ago

devops-agent:~# docker info Client: Version: 24.0.5 Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: 0.11.2 Path: /usr/libexec/docker/cli-plugins/docker-buildx

Server: Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 11 Server Version: 24.0.5 Storage Driver: vfs Logging Driver: json-file Cgroup Driver: systemd Cgroup Version: 2 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 runc Default Runtime: runc Init Binary: docker-init containerd version: runc version: init version: Security Options: apparmor seccomp Profile: builtin cgroupns Kernel Version: 5.15.85-1-pve Operating System: Ubuntu 23.04 OSType: linux Architecture: x86_64 CPUs: 6 Total Memory: 8GiB Name: x-devops-agent ID: c46981fd-09e1-4239-95e1-3129391ac89c Docker Root Dir: /var/lib/docker Debug Mode: false Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

VSVDEv commented 5 months ago

I have the same problem with proxy(can't pull) and hosted(can't push) type I run jenkins using vagrant with private ip. Maven and gradle works but docker doesn't added daemon.json { "insecure-registries" : ["100.0.0.16:5555", "100.0.0.16:7777"] } then restart docker

login for both and even tried separately and checked config.json <docker login -u username -p password host:port> 100.0.0.16:5555 - hosted 100.0.0.16:7777 - proxy of course role and user with credentials

"docker pull 100.0.0.16:7777/nginx Using default tag: latest Error response from daemon: Head "http://100.0.0.16:7777/v2/nginx/manifests/latest": no basic auth credentials"

"docker push 100.0.0.16:5555/micro:1 The push refers to repository [100.0.0.16:5555/micro] 2fd0c7265f41: Preparing 83b767b06655: Preparing 14fbd8039ba4: Preparing da55b45d310b: Preparing no basic auth credentials"

Nexus version OSS 3.60.0-02

jiaopengzi commented 3 weeks ago

me too.

root@pve108:~# docker login foo.com:5000
Username: testuser
Password: 
Login Succeeded
root@pve108:~# cat $HOME/.docker/config.json
{
        "auths": {
                "foo.com:5000": {}
        },
        "credsStore": "pass"
root@pve108:~# docker push foo.com:5000/blog-server:220
The push refers to repository [foo.com:5000/blog-server]
5f70bf18a086: Preparing 
f658d5695954: Preparing 
bf5f3113c63e: Preparing 
94e5f06ff8e3: Preparing 
no basic auth credentials
root@pve108:~# 

docker version

root@pve108:~# docker info
Client: Docker Engine - Community
 Version:    26.1.4
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.14.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 10
  Running: 8
  Paused: 0
  Stopped: 2
 Images: 11
 Server Version: 26.1.4
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: active
  NodeID: h77q0d6xzn350v77bbfszt68l
  Is Manager: true
  ClusterID: kyejthecrgxj8ghkr87r1ro6t
  Managers: 1
  Nodes: 1
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 10.10.10.108
  Manager Addresses:
   10.10.10.108:2377
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d2d58213f83a351ca8f528a95fbd145f5654e957
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.8.0-36-generic
 Operating System: Ubuntu 24.04 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.789GiB
 Name: pve108
 ID: 9db0d3de-a897-4b52-a69d-80f8646cf9c0
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

linux version

root@pve108:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:        24.04
Codename:       noble

~/.docker/config.json

{
        "auths": {
                "https://foo.com:5000": {}
        },
        "credsStore": "pass"
}

The last resort is to delete to successfully push.

apt remove gnupg2 pass -y
rm /usr/local/bin/docker-credential-pass