← Back to list

Running Jenkins CI/CD Pipeline with Docker on macOS without Docker Desktop (Using Colima)

Introduction

Jahnavi Pithadiya · 2026-03-15 15:08 · 0 claps · 2.4 min read
#jenkins #docker #colima #git
Open on Medium ↗
Wiki topics: ☁️ · DevOps & Cloud 🔓 · Open Source 🏃 · Running & Endurance

Running Jenkins CI/CD Pipeline with Docker on macOS without Docker Desktop (Using Colima)

Introduction

In this blog, I will share my experience setting up a complete CI/CD workflow using Jenkins, Docker, and a simple Flask application from GitHub — all on macOS without Docker Desktop.

Due to permission restrictions on my machine, I could not install Docker Desktop. This forced me to explore alternative approaches and troubleshoot multiple issues along the way.

This guide explains the problems I encountered and how I solved them step by step.

Problem 1: No Access to Docker Desktop

In many corporate environments, installing Docker Desktop requires administrator privileges. Since I didn’t have that access, I needed an alternative.

Solution: Install Docker using Colima

Colima allows you to run Docker containers on macOS without Docker Desktop.

Steps:

Install Docker CLI

brew install docker

Install Colima

brew install colima

Start Colima

colima start

Verify Docker installation

docker ps

Once Colima started successfully, Docker was working on my system.

Problem 2: No VM Available for Jenkins

Normally Jenkins runs on a VM or server, but since I didn’t have access to a VM, I decided to run Jenkins using Docker.

Running Jenkins Container

docker run -d \
-p 8080:8080 \
-p 50000:50000 \
--name jenkins \
jenkins/jenkins:lts

This started the Jenkins server inside a container.

Problem 3: Jenkins Pipeline for Flask Application

I created a simple pipeline that:

  1. Clones a GitHub repository
  2. Builds a Docker image from a Docker file
  3. Runs a container from the built image

Pipeline script:

pipeline {
    agent any
    stages {
        stage('Clone Repository') {
            steps {
                git branch: 'main', url: 'https://github.com/jahnavi411/Simple-flask-app.git'
            }
        }
        stage('Build Docker Image') {
            steps {
                sh 'docker build -t flask-app .'
            }
        }
        stage('Run Container') {
            steps {
                sh '''
                docker rm -f flask-app-container || true
                docker run -d -p 5000:5000 --name flask-app-container flask-app
                '''
            }
        }
    }
}

However, the pipeline failed with the following error:

docker: not found

Problem 4: Jenkins Container Cannot Run Docker

The Jenkins container could not run Docker commands because:

  1. Docker CLI was not installed inside the container
  2. Jenkins user did not have permission to access Docker

Solution Step 1: Run Jenkins Container as Root

I recreated the Jenkins container using the root user and mounted the Docker socket.

docker run -d \
-p 8080:8080 \
-p 50000:50000 \
--name jenkins \
-u root \
-v /var/run/docker.sock:/var/run/docker.sock \
jenkins/jenkins:lts

This allowed Jenkins to communicate with the host Docker daemon.

Solution Step 2: Install Docker CLI inside Jenkins Container

Next, I entered the container and installed Docker.

docker exec -u root -it jenkins bash

Then installed Docker CLI:

apt update
apt install -y docker.io

Now Jenkins was able to execute Docker commands.

Problem 5: Jenkins Data Lost After Container Restart

When the container was restarted, all Jenkins configurations were lost.

Solution: Use Docker Volume for Persistent Storage

To prevent Jenkins data from being deleted, I created a Docker volume.

docker volume create jenkins-data

Then started Jenkins with the volume:

docker run -d \
-p 8080:8080 \
-p 50000:50000 \
--name jenkins \
-u root \
-v jenkins-data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
jenkins/jenkins:lts

This ensured Jenkins data persisted even if the container was recreated.

Final Architecture

GitHub Repository
        ↓
Jenkins Pipeline
        ↓
Clone Source Code
        ↓
Docker Build
        ↓
Run Docker Container
        ↓
Flask Application Running

Conclusion

This setup allowed me to run a complete CI/CD workflow locally without:

  • Docker Desktop
  • A dedicated VM

Key learnings from this setup:

  • Colima can replace Docker Desktop on macOS
  • Jenkins can run inside Docker containers
  • Docker socket mounting enables Jenkins to control Docker
  • Docker volumes are essential for persistent Jenkins data

This approach provides a lightweight local DevOps environment suitable for experimentation and learning.


메타데이터
post_id
596f80f7dd8a
slug
running-jenkins-ci-cd-pipeline-with-docker-on-macos-without-docker-desktop-using-colima-596f80f7dd8a
url
https://medium.com/@jahnavi.pithadiya.411/running-jenkins-ci-cd-pipeline-with-docker-on-macos-without-docker-desktop-using-colima-596f80f7dd8a
canonical_url
https://medium.com/@jahnavi.pithadiya.411/running-jenkins-ci-cd-pipeline-with-docker-on-macos-without-docker-desktop-using-colima-596f80f7dd8a
author_url
https://medium.com/@jahnavi.pithadiya.411
status
ok
fetched_at
2026-07-11 23:07:18