I try to build istio
(1.6.0+) using Jenkins and get an error:
docker: Error response from daemon: invalid mount config for type "bind":
bind mount source path does not exist: /home/jenkins/.docker
the slave
contains .docker
directory:
13:34:42 + ls -a /home/jenkins
13:34:42 .
13:34:42 ..
13:34:42 agent
13:34:42 .bash_logout
13:34:42 .bash_profile
13:34:42 .bashrc
13:34:42 .cache
13:34:42 .docker
13:34:42 .gitconfig
13:34:42 .jenkins
13:34:42 .m2
13:34:42 .npmrc
13:34:42 .oracle_jre_usage
13:34:42 postgresql-9.4.1212.jar
13:34:42 .ssh
13:34:42 workspace
parts of Istio
script
export CONDITIONAL_HOST_MOUNTS=${CONDITIONAL_HOST_MOUNTS:-}
if [[ -d "${HOME}/.docker" ]]; then
CONDITIONAL_HOST_MOUNTS+="--mount type=bind,source=${HOME}/.docker,destination=/config/.docker,readonly "
fi
"${CONTAINER_CLI}" run --rm \
-u "${UID}:${DOCKER_GID}" \
--sig-proxy=true \
${DOCKER_SOCKET_MOUNT:--v /var/run/docker.sock:/var/run/docker.sock} \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
$CONTAINER_OPTIONS \
--env-file <(env | grep -v ${ENV_BLOCKLIST}) \
-e IN_BUILD_CONTAINER=1 \
-e TZ="${TIMEZONE:-$TZ}" \
--mount "type=bind,source=${PWD},destination=/work" \
--mount "type=volume,source=go,destination=/go" \
--mount "type=volume,source=gocache,destination=/gocache" \
${CONDITIONAL_HOST_MOUNTS} \
-w /work "${IMG}" "$@"
... Have you tried to use -v instead of --mount, do you have any error then?
❗️ I changed --mount
to -v
and error
disappeared
-v ${HOME}/.docker:/config/.docker