From 1eb0164c9977652f37cc3c7188d0ac1794133f56 Mon Sep 17 00:00:00 2001 From: amorozov Date: Tue, 4 Apr 2023 20:07:59 +0300 Subject: [PATCH] fix: fixed agent docker installation --- Jenkinsfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 33b7bae..7d15b6a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ def resolveImageName(env) { pipeline { agent { docker { - image 'alpinelinux/docker-cli' + image 'alpine:3.17.3' // Mount docker socket for docker-in-docker args '-v /var/run/docker.sock:/var/run/docker.sock' } @@ -21,6 +21,12 @@ pipeline { apk update && \ apk add --no-cache git """ + + sh """curl -fsSLO https://get.docker.com/builds/Linux/x86_64/docker-17.04.0-ce.tgz \ + && tar xzvf docker-17.04.0-ce.tgz \ + && mv docker/docker /usr/local/bin \ + && rm -r docker docker-17.04.0-ce.tgz""" + script { env.IMAGE_BASE_NAME = "jdk14-alpine" env.RELEASE_TAG_PREFIX = "release-" @@ -33,8 +39,7 @@ pipeline { } stage('build_docker') { steps { - sh "which docker" - sh "/usr/bin/docker build . --tag ${resolveImageName(env)}" + sh "docker build . --tag ${resolveImageName(env)}" } } stage('push_docker') {