drone-plugins / drone-docker

Drone plugin for publishing Docker images
http://plugins.drone.io/drone-plugins/drone-docker
Apache License 2.0
319 stars 321 forks source link

Issues when connecting to my registry #419

Closed HelifeWasTaken closed 10 months ago

HelifeWasTaken commented 10 months ago

First of all: https://discourse.drone.io/ returned me 404

Here is my issue I want to deploy an image to my private registry, here is my CI file:

---
kind: pipeline
type: docker
name: default

steps:
- name: build
  image: plugins/docker
  settings:
    repo: "phar-registry/PharOps/runner-test"
    tags: latest
    username:
      from_secret: docker_username
    password:
      from_secret: docker_password
    dockerfile: Dockerfile

Here are the console logs:

latest: Pulling from plugins/docker

Digest: sha256:2f157400c2cb7de1b309b0f044f119375108218e54d38e1340e00b9f93abdefb

Status: Image is up to date for plugins/docker:latest

+ /usr/local/bin/dockerd --data-root /var/lib/docker --host=unix:///var/run/docker.sock

Detected registry credentials

Error response from daemon: Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password

time="2024-01-09T19:31:49Z" level=fatal msg="error authenticating: exit status 1"

I expected it to connect to phar-registry and not registry-1.docker.io/v2 is there something i am not understanding.

The whole process is just i want it to build the project and push it to the given repository...

I already verified that my username and password let's me login into the registry and that my drone-server is on the same network by using docker inspect and i used phar-registry as the hostname in the dummy docker i used to test my credentials

HelifeWasTaken commented 10 months ago

My bad i found the issue (could not find it in the doc so I had to look at the code :/ )

---
kind: pipeline
type: docker
name: default

steps:
- name: build
  image: plugins/docker
  settings:
    registry: phar-registry
    repo: "phar-registry/phar/runner-test"
    tags: latest
    username:
      from_secret: docker_username
    password:
      from_secret: docker_password
    dockerfile: Dockerfile

Second problem (that was minor) was that I needed to have only lowercase on the repo's name

Hope this helps somebody :)