In step one we attempt to login via a vanilla docker container using secret variables as would be injected into the drone-docker plugin. This works with the output:
+ docker login -u $PLUGIN_USERNAME -p $PLUGIN_PASSWORD
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
Publish
The second step attempts to build the image and publish it using the drone-docker plugin. This uses the exact same secrets as above that work, although this fails with:
This could be related to issue #31. Drone mounts a config map to root to store the netrc file, which mounts a read-only directory to root. The Docker credentials are written to /root/.docker/config.json, which probably fails, and is the root cause of the login error.
I have a fix planned for issue #31 which I documented here. The fix is a little involved and requires a good amount of regression testing just to make sure that I donât break anything.
This should be patched now. Instead of mounting the .netrc as a config map we are injecting as environment variables [1]. I have a more permanent fix planned, but for now this should solve the problem.
I will close this thread once I have confirmation that the fix is working for a few of you.
In what version is it working? Iâve tested it with :1 and :1.8 but no success.
The docker running in the host machine (GCE) can connect fine to the registry.
My logs are the following:
Digest: sha256:014a753cb3c1178df355a6ce97c4bf1d1860802f41ed5ae07493ff8a74660d0f
3 Status: Image is up to date for plugins/docker:latest
4 + /usr/local/bin/dockerd --data-root /var/lib/docker --host=unix:///var/run/docker.sock
5 time=â2020-06-23T23:14:39.585067816Zâ level=info msg=âStarting upâ
6 time=â2020-06-23T23:14:39.587882448Zâ level=warning msg=âcould not change group /var/run/docker.sock to docker: group docker not foundâ
7 time=â2020-06-23T23:14:39.589461087Zâ level=info msg=âlibcontainerd: started new containerd processâ pid=31
8 time=â2020-06-23T23:14:39.589658999Zâ level=info msg=âparsed scheme: âunixââ module=grpc
9 time=â2020-06-23T23:14:39.589713699Zâ level=info msg=âscheme âunixâ not registered, fallback to default schemeâ module=grpc
10 time=â2020-06-23T23:14:39.589982435Zâ level=info msg=âccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock 0 }] }â module=grpc
11 time=â2020-06-23T23:14:39.590215757Zâ level=info msg=âClientConn switching balancer to âpick_firstââ module=grpc
12 time=â2020-06-23T23:14:39.612165470Zâ level=info msg=âstarting containerdâ revision=7ad184331fa3e55e52b890ea95e65ba581ae3429 version=v1.2.13
13 time=â2020-06-23T23:14:39.612620800Zâ level=info msg=âloading plugin âio.containerd.content.v1.contentââŚâ type=io.containerd.content.v1
14 time=â2020-06-23T23:14:39.613134435Zâ level=info msg=âloading plugin âio.containerd.snapshotter.v1.btrfsââŚâ type=io.containerd.snapshotter.v1
15 time=â2020-06-23T23:14:39.615147019Zâ level=warning msg=âfailed to load plugin io.containerd.snapshotter.v1.btrfsâ error=âpath /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotterâ
16 time=â2020-06-23T23:14:39.615223226Zâ level=info msg=âloading plugin âio.containerd.snapshotter.v1.aufsââŚâ type=io.containerd.snapshotter.v1
17 time=â2020-06-23T23:14:39.620358648Zâ level=warning msg=âfailed to load plugin io.containerd.snapshotter.v1.aufsâ error=âmodprobe aufs failed: âip: canât find device âaufsâ\naufs 258048 0 \nmodprobe: canât change directory to â/lib/modulesâ: No such file or directory\nâ: exit status 1â
18 time=â2020-06-23T23:14:39.620384661Zâ level=info msg=âloading plugin âio.containerd.snapshotter.v1.nativeââŚâ type=io.containerd.snapshotter.v1
19 time=â2020-06-23T23:14:39.620574898Zâ level=info msg=âloading plugin âio.containerd.snapshotter.v1.overlayfsââŚâ type=io.containerd.snapshotter.v1
20 time=â2020-06-23T23:14:39.620820415Zâ level=info msg=âloading plugin âio.containerd.snapshotter.v1.zfsââŚâ type=io.containerd.snapshotter.v1
21 time=â2020-06-23T23:14:39.621150228Zâ level=info msg=âskip loading plugin âio.containerd.snapshotter.v1.zfsââŚâ type=io.containerd.snapshotter.v1
22 time=â2020-06-23T23:14:39.621171863Zâ level=info msg=âloading plugin âio.containerd.metadata.v1.boltââŚâ type=io.containerd.metadata.v1
23 time=â2020-06-23T23:14:39.621232310Zâ level=warning msg=âcould not use snapshotter btrfs in metadata pluginâ error=âpath /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotterâ
24 time=â2020-06-23T23:14:39.621241992Zâ level=warning msg=âcould not use snapshotter aufs in metadata pluginâ error=âmodprobe aufs failed: âip: canât find device âaufsâ\naufs 258048 0 \nmodprobe: canât change directory to â/lib/modulesâ: No such file or directory\nâ: exit status 1â
25 time=â2020-06-23T23:14:39.621252518Zâ level=warning msg=âcould not use snapshotter zfs in metadata pluginâ error=âpath /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter: skip pluginâ
26 time=â2020-06-23T23:14:39.628938216Zâ level=info msg=âloading plugin âio.containerd.differ.v1.walkingââŚâ type=io.containerd.differ.v1
27 time=â2020-06-23T23:14:39.628978564Zâ level=info msg=âloading plugin âio.containerd.gc.v1.schedulerââŚâ type=io.containerd.gc.v1
28 time=â2020-06-23T23:14:39.629023113Zâ level=info msg=âloading plugin âio.containerd.service.v1.containers-serviceââŚâ type=io.containerd.service.v1
29 time=â2020-06-23T23:14:39.629040927Zâ level=info msg=âloading plugin âio.containerd.service.v1.content-serviceââŚâ type=io.containerd.service.v1
30 time=â2020-06-23T23:14:39.629054801Zâ level=info msg=âloading plugin âio.containerd.service.v1.diff-serviceââŚâ type=io.containerd.service.v1
31 time=â2020-06-23T23:14:39.629069094Zâ level=info msg=âloading plugin âio.containerd.service.v1.images-serviceââŚâ type=io.containerd.service.v1
32 time=â2020-06-23T23:14:39.629084538Zâ level=info msg=âloading plugin âio.containerd.service.v1.leases-serviceââŚâ type=io.containerd.service.v1
33 time=â2020-06-23T23:14:39.629120801Zâ level=info msg=âloading plugin âio.containerd.service.v1.namespaces-serviceââŚâ type=io.containerd.service.v1
34 time=â2020-06-23T23:14:39.629136616Zâ level=info msg=âloading plugin âio.containerd.service.v1.snapshots-serviceââŚâ type=io.containerd.service.v1
35 time=â2020-06-23T23:14:39.629155271Zâ level=info msg=âloading plugin âio.containerd.runtime.v1.linuxââŚâ type=io.containerd.runtime.v1
36 time=â2020-06-23T23:14:39.629384797Zâ level=info msg=âloading plugin âio.containerd.runtime.v2.taskââŚâ type=io.containerd.runtime.v2
37 time=â2020-06-23T23:14:39.629509973Zâ level=info msg=âloading plugin âio.containerd.monitor.v1.cgroupsââŚâ type=io.containerd.monitor.v1
38 time=â2020-06-23T23:14:39.629981908Zâ level=info msg=âloading plugin âio.containerd.service.v1.tasks-serviceââŚâ type=io.containerd.service.v1
39 time=â2020-06-23T23:14:39.630021986Zâ level=info msg=âloading plugin âio.containerd.internal.v1.restartââŚâ type=io.containerd.internal.v1
40 time=â2020-06-23T23:14:39.630075400Zâ level=info msg=âloading plugin âio.containerd.grpc.v1.containersââŚâ type=io.containerd.grpc.v1
41 time=â2020-06-23T23:14:39.630091176Zâ level=info msg=âloading plugin âio.containerd.grpc.v1.contentââŚâ type=io.containerd.grpc.v1
42 time=â2020-06-23T23:14:39.630104663Zâ level=info msg=âloading plugin âio.containerd.grpc.v1.diffââŚâ type=io.containerd.grpc.v1
43 time=â2020-06-23T23:14:39.630167222Zâ level=info msg=âloading plugin âio.containerd.grpc.v1.eventsââŚâ type=io.containerd.grpc.v1
44 time=â2020-06-23T23:14:39.630183988Zâ level=info msg=âloading plugin âio.containerd.grpc.v1.healthcheckââŚâ type=io.containerd.grpc.v1
45 time=â2020-06-23T23:14:39.630198287Zâ level=info msg=âloading plugin âio.containerd.grpc.v1.imagesââŚâ type=io.containerd.grpc.v1
46 time=â2020-06-23T23:14:39.630212407Zâ level=info msg=âloading plugin âio.containerd.grpc.v1.leasesââŚâ type=io.containerd.grpc.v1
47 time=â2020-06-23T23:14:39.630225858Zâ level=info msg=âloading plugin âio.containerd.grpc.v1.namespacesââŚâ type=io.containerd.grpc.v1
48 time=â2020-06-23T23:14:39.630241473Zâ level=info msg=âloading plugin âio.containerd.internal.v1.optââŚâ type=io.containerd.internal.v1
49 time=â2020-06-23T23:14:39.630775971Zâ level=info msg=âloading plugin âio.containerd.grpc.v1.snapshotsââŚâ type=io.containerd.grpc.v1
50 time=â2020-06-23T23:14:39.630808635Zâ level=info msg=âloading plugin âio.containerd.grpc.v1.tasksââŚâ type=io.containerd.grpc.v1
51 time=â2020-06-23T23:14:39.630823755Zâ level=info msg=âloading plugin âio.containerd.grpc.v1.versionââŚâ type=io.containerd.grpc.v1
52 time=â2020-06-23T23:14:39.630837937Zâ level=info msg=âloading plugin âio.containerd.grpc.v1.introspectionââŚâ type=io.containerd.grpc.v1
53 time=â2020-06-23T23:14:39.631236295Zâ level=info msg=serving⌠address="/var/run/docker/containerd/containerd-debug.sock"
54 time=â2020-06-23T23:14:39.631335174Zâ level=info msg=serving⌠address="/var/run/docker/containerd/containerd.sock"
55 time=â2020-06-23T23:14:39.631352859Zâ level=info msg=âcontainerd successfully booted in 0.019879sâ
56 time=â2020-06-23T23:14:39.639920173Zâ level=info msg=âparsed scheme: âunixââ module=grpc
57 time=â2020-06-23T23:14:39.639960571Zâ level=info msg=âscheme âunixâ not registered, fallback to default schemeâ module=grpc
58 time=â2020-06-23T23:14:39.639985896Zâ level=info msg=âccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock 0 }] }â module=grpc
59 time=â2020-06-23T23:14:39.639998454Zâ level=info msg=âClientConn switching balancer to âpick_firstââ module=grpc
60 time=â2020-06-23T23:14:39.641054038Zâ level=info msg=âparsed scheme: âunixââ module=grpc
61 time=â2020-06-23T23:14:39.641082435Zâ level=info msg=âscheme âunixâ not registered, fallback to default schemeâ module=grpc
62 time=â2020-06-23T23:14:39.641104996Zâ level=info msg=âccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock 0 }] }â module=grpc
63 time=â2020-06-23T23:14:39.641164098Zâ level=info msg=âClientConn switching balancer to âpick_firstââ module=grpc
64 time=â2020-06-23T23:14:39.642676887Zâ level=error msg=âNo zfs dataset found for rootâ backingFS=extfs root=/var/lib/docker storage-driver=zfs
65 time=â2020-06-23T23:14:39.671801221Zâ level=warning msg=âYour kernel does not support swap memory limitâ
66 time=â2020-06-23T23:14:39.671836411Zâ level=warning msg=âYour kernel does not support cgroup rt periodâ
67 time=â2020-06-23T23:14:39.671844903Zâ level=warning msg=âYour kernel does not support cgroup rt runtimeâ
68 time=â2020-06-23T23:14:39.671850645Zâ level=warning msg=âYour kernel does not support cgroup blkio weightâ
69 time=â2020-06-23T23:14:39.671860895Zâ level=warning msg=âYour kernel does not support cgroup blkio weight_deviceâ
70 time=â2020-06-23T23:14:39.672410332Zâ level=info msg=âLoading containers: start.â
71 time=â2020-06-23T23:14:39.732348361Zâ level=info msg=âDefault bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP addressâ
72 time=â2020-06-23T23:14:39.764680340Zâ level=info msg=âLoading containers: done.â
73 time=â2020-06-23T23:14:39.775296436Zâ level=info msg=âDocker daemonâ commit=afacb8b7f0 graphdriver(s)=overlay2 version=19.03.8
74 time=â2020-06-23T23:14:39.775518256Zâ level=info msg=âDaemon has completed initializationâ
75 time=â2020-06-23T23:14:39.808804189Zâ level=info msg=âAPI listen on /var/run/docker.sockâ
76 time=â2020-06-23T23:14:39.949008471Zâ level=error msg=âHandler for POST /v1.40/auth returned error: Get https://us-central1-docker.pkg.dev/v2/: unauthorized: authentication failedâ
77 time=â2020-06-23T23:14:39Zâ level=fatal msg=âError authenticating: exit status 1â
@manobi this issue was for the 1.0 release candidate (and is quite old). There are no known issues with using the docker plugin if you are using the latest version of the kubernetets runner or docker runner (providing your yaml is generally recommended so we can advise further). Make sure you are providing the plugin with your registry credentials via the username and password attributes as shown here: http://plugins.drone.io/drone-plugins/drone-docker/
Thanks @bradrydzewski, Iâm already declaring my credentials, it might be something with the new Google Artifact registry.
I could not make it work with plugins/docker, which Iâve had beeing using for 6 months with Oracle container registry.
Unfortunately I had to move to plugins/gcr now itâs working, Iâm migrating more repos today and will again and post my pipeline here.
The first does not work and last works as expected (please click on the link to see the original with credentials, which donât appear in preview).
Do you think itâs how my âkeyâ is formated someway?