pipeline { agent any environment { GITHUB_TOKEN = credentials('github') IMAGE_NAME = 'ghcr.io/finkash-pty/frappe_docker' RELEASE_VERSION = readFile('version').trim() IMAGE_REPO = "${IMAGE_NAME}:${RELEASE_VERSION}" PLATFORM = 'linux/amd64,linux/arm64' DOCKERFILE_PATH = './images/production/Containerfile' } stages { stage('Login to image Repository') { steps { sh 'echo $GITHUB_TOKEN_PSW | docker login ghcr.io -u GITHUB_TOKEN_USR --password-stdin' } } stage('Prepare Builder'){ steps{ script{ sh 'export DOCKER_CLI_EXPERIMENTAL=enabled' sh 'docker buildx use multiplatformbuilder' } } } stage('Debug: List Directory Contents') { steps { script { sh 'ls -la' sh 'ls -la ./images' sh 'ls -la ./images/production' } } } stage('Build Image') { steps { script { sh "docker buildx build --platform $PLATFORM --cache-from type=local,src=$IMAGE_REPO --cache-to type=local,dest=/tmp/.buildx-cache --push --tag $IMAGE_REPO $DOCKERFILE_PATH" } } } } post { always { cleanWs() } } }