I’m attempting to use sidecar containers following the examples detailed here, the first example gets stuck in a loop unable to find ‘mysqladmin’.
+ mysqladmin ping -h0.0.0.0 --silent
/Users/clint/.jenkins/workspace/aaa@tmp/durable-66a0a38e/script.sh: line 1: mysqladmin: command not found
+ sleep 1
+ mysqladmin ping -h0.0.0.0 --silent
/Users/clint/.jenkins/workspace/aaa@tmp/durable-66a0a38e/script.sh: line 1: mysqladmin: command not found
+ sleep 1
+ mysqladmin ping -h0.0.0.0 --silent
/Users/clint/.jenkins/workspace/aaa@tmp/durable-66a0a38e/script.sh: line 1: mysqladmin: command not found
+ sleep 1
+ mysqladmin ping -h0.0.0.0 --silent
/Users/clint/.jenkins/workspace/aaa@tmp/durable-66a0a38e/script.sh: line 1: mysqladmin: command not found
+ sleep 1
+ mysqladmin ping -h0.0.0.0 --silent
/Users/clint/.jenkins/workspace/aaa@tmp/durable-66a0a38e/script.sh: line 1: mysqladmin: command not found
+ sleep 1
+ mysqladmin ping -h0.0.0.0 --silent
/Users/clint/.jenkins/workspace/aaa@tmp/durable-66a0a38e/script.sh: line 1: mysqladmin: command not found
+ sleep 1
The second example utilizing two containers simultaneously works as expected though. But when I try to do a similar style using PostgreSQL instead:
node {
checkout scm
docker.image('postgres:12').withRun('-p 5432:5432 -e POSTGRES_DB=mydb -e POSTGRES_USER=myuser -e POSTGRES_PASSWORD=mypass') { c ->
docker.image('postgres:12').inside("--link ${c.id}:db") {
sh 'while ! pg_isready; do sleep 1; done'
}
docker.image('centos:7').inside("--link ${c.id}:db") {
sh 'make check'
}
}
}
It also gets stuck waiting:
+ pg_isready
/var/run/postgresql:5432 - no attempt
+ sleep 1
+ pg_isready
/var/run/postgresql:5432 - no attempt
+ sleep 1
+ pg_isready
/var/run/postgresql:5432 - no attempt
+ sleep 1
+ pg_isready
/var/run/postgresql:5432 - no attempt
+ sleep 1
+ pg_isready
/var/run/postgresql:5432 - no attempt
+ sleep 1
+ pg_isready
/var/run/postgresql:5432 - no attempt
+ sleep 1
+ pg_isready
/var/run/postgresql:5432 - no attempt