Skip to content

Commit

Permalink
fix: mount Docker credentials (#17798)
Browse files Browse the repository at this point in the history
* fix: mount Docker credentials

* Apply suggestions from code review

* Apply suggestions from code review
  • Loading branch information
kuisathaverat authored Apr 23, 2020
1 parent 07d0c8c commit be3ec38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -647,14 +647,8 @@ def withBeatsEnv(boolean archive, Closure body) {
]) {
deleteDir()
unstash 'source'
if(os == 'linux'){
if(isDockerInstalled()){
dockerLogin(secret: "${DOCKERELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")
// FIXME workaround until we fix the packer cache
// Retry to avoid DDoS detection from the server
retry(3) {
sleep randomNumber(min: 2, max: 5)
sh 'docker pull docker.elastic.co/observability-ci/database-enterprise:12.2.0.1'
}
}
dir("${env.BASE_DIR}") {
sh(label: "Install Go ${GO_VERSION}", script: ".ci/scripts/install-go.sh")
Expand Down Expand Up @@ -954,3 +948,7 @@ def setGitConfig(){
fi
''')
}

def isDockerInstalled(){
return sh(label: 'check for Docker', script: 'command -v docker', returnStatus: true)
}
1 change: 1 addition & 0 deletions x-pack/metricbeat/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
volumes:
- ${PWD}/../..:/go/src/github.com/elastic/beats/
- /var/run/docker.sock:/var/run/docker.sock
- ${HOME}/.docker:/root/.docker:ro
network_mode: host
command: make

Expand Down

0 comments on commit be3ec38

Please sign in to comment.