Hello! First question in here! I’m trying to learn about Jenkins and i’m stumbling with some problems with creating a pipeline with Docker.
This is my Dockerfile:
FROM ubuntu:24.04
RUN apt-get update && apt-get install --no-install-recommends -y \
libssl-dev \
zlib1g-dev \
cmake \
pkg-config \
g++ \
gcc \
git \
fontconfig \
make && \
apt-get clean
WORKDIR /app
This is my Jenkins pipeline file:
pipeline {
agent any
stages {
stage('Build') {
agent {
docker {
image 'mydocker:latest'
}
}
steps {
sh 'git --version'
}
}
}
}
Git version command returns error with “git not found”. Running “sh cat /etc/lsb-release” instead outputs ubuntu version 22.04 which is the one I’m using as a host…
What i am missing in here? Thanks!