diff --git a/jenkins/Dockerfile b/jenkins/Dockerfile index e9240e81c0c942aa5417369e795e18233ddfa12c..47205be6261754db36b2b342ceab7444a8856b50 100644 --- a/jenkins/Dockerfile +++ b/jenkins/Dockerfile @@ -21,6 +21,12 @@ COPY sources.list /etc/apt/sources.list RUN apt-get update \ && apt-get install -y git curl \ + && apt-get install sudo -y --allow-unauthenticated \ + && apt-get -y install apt-transport-https ca-certificates software-properties-common \ + && curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | apt-key add - \ + && add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" \ + && apt-get -y update \ + && apt-get -y install docker-ce \ && rm -rf /var/lib/apt/lists/* ARG user=jenkins @@ -37,7 +43,8 @@ ENV JENKINS_SLAVE_AGENT_PORT ${agent_port} # If you bind mount a volume from the host or a data container, # ensure you use the same uid RUN groupadd -g ${gid} ${group} \ - && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -m -s /bin/bash ${user} + && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -m -s /bin/bash ${user} \ + && usermod -aG docker ${user} # Jenkins home directory is a volume, so configuration and build history # can be persisted and survive image upgrades