I have created a docker private insecure registry and configured the daemon.json file so that push and pull to the insecure repository would work from the host machine. However, when I try to use images from the private insecure repository inside the plugin/docker I get the following error:
Step 1/8 : FROM 192.168.100.1:5000/python:3.7.8-slim-stretch
Get https://192.168.100.1:5000/v2/: http: server gave HTTP response to HTTPS client
To narrow this down I created a sample Docker file pull from local registry and realised the following command works and builds the docker successfully:
docker run --rm \
-e PLUGIN_TAG=latest \
-e PLUGIN_REPO=192.168.100.1:5000/sample \
-e DRONE_COMMIT_SHA=d8dbe4d94f15fe89232e0402c6e8a0ddf21af3ab \
-v $(pwd):$(pwd) \
-w $(pwd) \
-v /var/run/docker.sock:/var/run/docker.sock \
--privileged \
plugins/docker --dry-run
However, when I remove the docker.sock
volume in the following command it does not work:
docker run --rm \
-e PLUGIN_TAG=latest \
-e PLUGIN_REPO=192.168.100.1:5000/sample \
-e DRONE_COMMIT_SHA=d8dbe4d94f15fe89232e0402c6e8a0ddf21af3ab \
-v $(pwd):$(pwd) \
-w $(pwd) \
--privileged \
plugins/docker --dry-run
and here is the output:
docker run --rm \
> -e PLUGIN_TAG=latest \
> -e PLUGIN_REPO=192.168.100.1:5000/sample \
> -e DRONE_COMMIT_SHA=d8dbe4d94f15fe89232e0402c6e8a0ddf21af3ab \
> -v $(pwd):$(pwd) \
> -w $(pwd) \
> --privileged \
> plugins/docker --dry-run
+ /usr/local/bin/dockerd --data-root /var/lib/docker --host=unix:///var/run/docker.sock
Registry credentials or Docker config not provided. Guest mode enabled.
+ /usr/local/bin/docker version
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: afacb8b7f0
Built: Wed Mar 11 01:22:56 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: afacb8b7f0
Built: Wed Mar 11 01:30:32 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
+ /usr/local/bin/docker info
Client:
Debug Mode: false
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 19.03.8
Storage Driver: overlay2
Backing Filesystem: <unknown>
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
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: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.15.0-122-generic
Operating System: Alpine Linux v3.11 (containerized)
OSType: linux
Architecture: x86_64
CPUs: 4
WARNING: No swap limit support
Total Memory: 15.66GiB
Name: 7fb445ddee82
ID: WKFW:OL53:JOLQ:MVD2:LWRJ:K2Q7:7D6L:JDDF:LFN3:JOQB:PYOP:ZU3N
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
+ /usr/local/bin/docker build --rm=true -f Dockerfile -t d8dbe4d94f15fe89232e0402c6e8a0ddf21af3ab . --pull=true --label org.label-schema.schema-version=1.0 --label org.label-schema.build-date=2020-11-06T09:57:37Z --label org.label-schema.vcs-ref=d8dbe4d94f15fe89232e0402c6e8a0ddf21af3ab --label org.label-schema.vcs-url=
Sending build context to Docker daemon 76.29kB
Step 1/8 : FROM 192.168.100.1:5000/python:3.7.8-slim-stretch
Get https://192.168.100.1:5000/v2/: http: server gave HTTP response to HTTPS client
time="2020-11-06T09:57:37Z" level=fatal msg="exit status 1"
And suggestion how the docker.sock volume may not be mapped from the runner instance to the plugin/docker?
Thanks.