I wrote the code of dockerfile so it will be easier to install jenkins with all it dependencies and use it for CICD pipeline(i am using docker on windows 10).
this is my code:
FROM jenkins/jenkins:lts
USER root
VOLUME /var/run/docker.sock
# install necessary packages to run docker
RUN apt-get -qq -y update && apt-get -qq -y install curl
&& apt-get -qq -y update && apt-get -qq -y install sudo
&& apt-get -qq -y update && apt-get -qq -y install apt-transport-https ca-certificates curl gnupg2
software-properties-common
&& apt-get -qq -y update && apt-get -qq -y install gedit
&& apt-get -qq -y update && apt-get -qq -y install maven 3.6.0
&& apt-get -qq -y update && apt-get -qq -y install docker.io
&& apt-get -qq -y update && apt-get -qq -y install build-essential fakeroot dpkg-dev
&& apt-get -qq -y update && apt-get -qq -y install libcurl4-openssl-devpi
My CMD shows this error:"E: The repository ‘https://packagecloud.io/github/git-lfs/debian buster Release’ does not have a Release file."
2
Answers
Using Docker build command
I hope that this can help you to resolve your issue
You do not need to run
apt-get -qq -y update && apt-get -qq -y install
after every single installation.There was also some syntax errors in packages name.
I fixed those.
Here is your Dockerfile after fixing it :
Then just run the command :
docker build -t <your_docker_username>/<image_name> .