0

I'm trying to write a script that creates a Docker image from a Jenkins image, that is, the first line of my Dockerfile is...

FROM jenkins/jenkins:2.249.3

However I wanna be smart and write a script that gets the latest Jenkins stable version and sed that into my Dockerfile, like this

Dockerfile:
FROM jenkins/jenkins:JENKINS_LATEST_STABLE_VER

$ export JENKINS_LATEST_STABLE_VER=`some_api_call`
$ sed -i "s/JENKINS_LATEST_STABLE_VER/$JENKINS_LATEST_STABLE_VER/g" Dockerfile
$ docker build ...

What is "some_api_call" ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.