skip to Main Content

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


  1. Using Docker build command

    docker build -t image_name:image_tag path_to_dockerfile

    I hope that this can help you to resolve your issue

    Login or Signup to reply.
  2. 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 :

    
    FROM jenkins/jenkins:lts
    USER root
    
    VOLUME /var/run/docker.sock
    # install necessary packages to run docker
    RUN apt-get -y update && apt-get -y install curl 
        apt-transport-https ca-certificates curl gnupg2 
        software-properties-common gedit maven docker.io 
        build-essential fakeroot dpkg-dev 
        libcurl4-openssl-dev
    
    CMD ["sh"] #You do not need this line maybe you have your own default command to run
    
    

    Then just run the command :

    docker build -t <your_docker_username>/<image_name> .

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search