Trying to start Docker daemon in script.
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
Can possibly help with authorization problems.
This commit is contained in:
parent
a26adfc78b
commit
5dd146d2c0
14
.drone.yml
14
.drone.yml
@ -22,22 +22,10 @@ trigger:
|
||||
branch: ["main"]
|
||||
|
||||
steps:
|
||||
- name: "docker"
|
||||
- name: "mirror"
|
||||
image: "docker:20.10.17-dind"
|
||||
pull: if-not-exists
|
||||
detach: true
|
||||
privileged: true
|
||||
environment:
|
||||
DOCKER_HOST: tcp://0.0.0.0:2375
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
commands:
|
||||
- /usr/local/bin/dockerd --data-root=/var/lib/docker --host=tcp://0.0.0.0:2375 --tls=false
|
||||
|
||||
- name: "mirror"
|
||||
image: "docker:20.10.17"
|
||||
pull: if-not-exists
|
||||
environment:
|
||||
DOCKER_HOST: tcp://docker:2375
|
||||
REGISTRY: code.pztrn.name
|
||||
REGISTRY_USER: drone
|
||||
REGISTRY_PASSWORD:
|
||||
|
12
mirror.sh
12
mirror.sh
@ -7,6 +7,17 @@ DESTINATION_PROJECT=${DESTINATION_REGISTRY}/containers/mirror
|
||||
USER=${REGISTRY_USER}
|
||||
PASSWORD=${REGISTRY_PASSWORD}
|
||||
|
||||
# Starting Docker daemon.
|
||||
/usr/local/bin/dockerd --data-root=/var/lib/docker &
|
||||
|
||||
# Wait for it.
|
||||
echo "Waiting for Docker daemon to start..."
|
||||
while true; do
|
||||
if docker ps &> /dev/null; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
MIRROR_CONFIGS=$(ls ./images/*.sh)
|
||||
# shellcheck disable=SC2068
|
||||
for file in ${MIRROR_CONFIGS[@]}; do
|
||||
@ -52,7 +63,6 @@ function mirror() {
|
||||
# Login to registry.
|
||||
echo "Logging into '${DESTINATION_REGISTRY}' as '${USER}'..."
|
||||
docker login -u "${USER}" -p "${PASSWORD}" "${DESTINATION_REGISTRY}"
|
||||
cat ~/.docker/config.json
|
||||
|
||||
# Mirror images.
|
||||
for image in "${WHAT_TO_MIRROR[@]}"; do
|
||||
|
Loading…
Reference in New Issue
Block a user