Sign inSign up

organicvirender/jnlp-chrome-agent

By organicvirender

•Updated over 5 years ago

Image
0

1.8K

organicvirender/jnlp-chrome-agent repository overview

FROM jenkins/inbound-agent as builder

FROM ubuntu:20.04 LABEL name="Java Build Tools with node and chrome"
license="Apache-2.0"
version="latest"
summary="Convenient Docker image to build Java and node applications with chrome installed for tests."
description="Convenient Docker image to build Java and node applications with chrome installed for tests."

RUN DISTRIB_CODENAME=$(cat /etc/release | grep DISTRIB_CODENAME | cut -f2 -d'=')
&& echo "deb http://archive.ubuntu.com/ubuntu⁠ ${DISTRIB_CODENAME} main universe\n" > /etc/apt/sources.list
&& echo "deb http://archive.ubuntu.com/ubuntu⁠ ${DISTRIB_CODENAME}-updates main universe\n" >> /etc/apt/sources.list
&& echo "deb http://security.ubuntu.com/ubuntu⁠ ${DISTRIB_CODENAME}-security main universe\n" >> /etc/apt/sources.list

RUN apt-get update -qqy
&& apt-get -qqy --no-install-recommends install software-properties-common
&& add-apt-repository -y ppa:git-core/ppa

RUN apt-get update -qqy
&& apt-get -qqy --no-install-recommends install
iproute2
openssh-client ssh-askpass
ca-certificates
gpg gpg-agent
openjdk-11-jdk
tar zip unzip
wget curl
git
build-essential
less nano tree
jq
python3 python3-pip groff
rsync
nodejs
&& apt-get clean

RUN pip3 install --upgrade pip setuptools

RUN pip3 install yq

RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg⁠ | apt-key add -

RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu⁠ focal stable"

RUN apt-get -qqy install --no-install-recommends docker-ce docker-ce-cli containerd.io

RUN apt-get update

RUN apt-get install sudo -y

ENV MAVEN_VERSION 3.6.3

RUN curl -fsSL http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz⁠ | tar xzf - -C /usr/share
&& mv /usr/share/apache-maven-$MAVEN_VERSION /usr/share/maven
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

ENV MAVEN_HOME /usr/share/maven

ENV GRADLE_VERSION 6.5.1

RUN wget -q https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip⁠ -P /tmp
&& unzip -d /opt/gradle /tmp/gradle-${GRADLE_VERSION}-bin.zip
&& ln -s /opt/gradle/gradle-${GRADLE_VERSION}/bin/gradle /usr/bin/gradle
&& rm /tmp/gradle-${GRADLE_VERSION}-bin.zip

RUN useradd jenkins --shell /bin/bash --create-home
&& usermod -a -G sudo jenkins
&& echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers
&& echo 'jenkins ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
&& echo 'jenkins:secret' | chpasswd

RUN pip3 install awscli

RUN mkdir -p /home/jenkins/.local/bin/
&& ln -s /usr/local/bin/pip /home/jenkins/.local/bin/pip
&& chown -R jenkins:jenkins /home/jenkins/.local

RUN mkdir -p /home/jenkins/.m2

RUN CHROMEDRIVER_VERSION=curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE &&
mkdir -p /opt/chromedriver-$CHROMEDRIVER_VERSION &&
curl -sS -o /tmp/chromedriver_linux64.zip http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip⁠ &&
unzip -qq /tmp/chromedriver_linux64.zip -d /opt/chromedriver-$CHROMEDRIVER_VERSION &&
rm /tmp/chromedriver_linux64.zip &&
chmod +x /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver &&
ln -fs /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver /usr/local/bin/chromedriver

RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub⁠ | apt-key add - &&
echo "deb http://dl.google.com/linux/chrome/deb/⁠ stable main" >> /etc/apt/sources.list.d/google-chrome.list &&
apt-get -yqq update &&
apt-get -yqq install google-chrome-stable &&
rm -rf /var/lib/apt/lists/*

RUN google-chrome --version
&& chromedriver --version

COPY --from=builder /usr/local/bin/jenkins-slave /usr/local/bin/jenkins-agent COPY --from=builder /usr/share/jenkins/agent.jar /usr/share/jenkins/agent.jar

USER root

RUN chmod +x /usr/local/bin/jenkins-agent
&& ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave RUN chmod 644 /usr/share/jenkins/agent.jar
&& ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar

USER jenkins

ENTRYPOINT ["jenkins-agent"]

Tag summary

Content type

Image

Digest

Size

922.7 MB

Last updated

over 5 years ago

docker pull organicvirender/jnlp-chrome-agent