Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7144

Offline Installation of softwares in Ubuntu 22.04 Docker container [closed]

$
0
0

We are trying to create containerized AzureDevops self hosted agent machine with required software components installed by following the MS Document

Our Build agent VMs and the jump machines are hosted in airgap environment and we don't have any internet enabled machine to do the package installation. So we were using our private JFrog Artifactory remote repositories to update the apt packages for ubuntu 22.04.

Below is the DockerFile component we are trying to integrate with the Private JFrog repo configuration by adding the sources.list with artifactory settings.

FROM ubuntu:22.04#2-Enable Ubuntu PackagesENV TARGETARCH="linux-x64"ENV DEBIAN_FRONTEND=noninteractiveRUN echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyesRUN echo "Acquire::https::Verify-Peer false;" > /etc/apt/apt.conf.d/99disable-ssl-verificationRUN rm -f /etc/apt/sources.list.d/archive_uri-*COPY ./sources.list /etc/apt/RUN apt-get updateRUN apt upgrade -yRUN apt-get install -y --no-install-recommends ca-certificates curl wget jq yarn  vim

sources.list file added with below remote endpoint urls

deb [trusted=yes] https://user:password@myrepo.com/artifactory/ubuntu-archve-remote-repo jammy maindeb [trusted=yes] https://user:password@myrepo.com/artifactory/ubuntu-archve-remote-repo jammy universedeb [trusted=yes] https://user:password@myrepo.com/artifactory/ubuntu-archve-remote-repo jammy restricteddeb [trusted=yes] https://user:password@myrepo.com/artifactory/ubuntu-archve-remote-repo jammy multiversedeb [trusted=yes] https://user:password@myrepo.com/artifactory/ubuntu-security-remote-repo jammy maindeb [trusted=yes] https://user:password@myrepo.com/artifactory/azure-ubuntu-remote-repo/ jammy main restricteddeb [trusted=yes] https://user:password@myrepo.com/artifactory/azure-ubuntu-remote-repo/ jammy-updates main restricteddeb [trusted=yes] https://user:password@myrepo.com/artifactory/azure-ubuntu-remote-repo/ jammy universedeb [trusted=yes] https://user:password@myrepo.com/artifactory/azure-ubuntu-remote-repo/ jammy-updates universedeb [trusted=yes] https://user:password@myrepo.com/artifactory/azure-ubuntu-remote-repo/ jammy multiversedeb [trusted=yes] https://user:password@myrepo.com/artifactory/azure-ubuntu-remote-repo/ jammy-updates multiversedeb [trusted=yes] https://user:password@myrepo.com/artifactory/azure-ubuntu-remote-repo/ jammy-backports main restricted universe multiversedeb [trusted=yes] https://user:password@myrepo.com/artifactory/azure-ubuntu-remote-repo/ jammy-security main restricteddeb [trusted=yes] https://user:password@myrepo.com/artifactory/azure-ubuntu-remote-repo/ jammy-security universedeb [trusted=yes] https://user:password@myrepo.com/artifactory/azure-ubuntu-remote-repo/ jammy-security multiverse

Here

Ubuntu arvive remote repo in Jfrog is pointing to - > http://archive.ubuntu.com/ubuntu/ubuntu-security-remote-repo in Jfrog  -> http://security.ubuntu.com/ubuntu/azure-ubuntu-remote-repo-  http://azure.archive.ubuntu.com/ubuntu/

The above repo configurations working with the Apt-update. But we have the requirement to install below components latest version on this docker container and which is failing with no package availability

Git- latestMaven- latestNodeJS -  20.xjfcli- latestAzureCLI - 2.61

Solution tried but failed due to neywork connectivity issue

#4-Install AzureCLIRUN curl -LsS https://aka.ms/InstallAzureCLIDeb | bash \&& rm -rf /var/lib/apt/lists/*#5- Instal HelmARG HELM_VERSION="xxxx"ARG HELM_LOCATION="https://get.helm.sh"ARG HELM_FILENAME="helm-${HELM_VERSION}-linux-amd64.tar.gz"RUN set -x && \    wget ${HELM_LOCATION}/${HELM_FILENAME} && \    echo Verifying ${HELM_FILENAME}... && \    echo Extracting ${HELM_FILENAME}... && \    tar zxvf ${HELM_FILENAME} && mv /linux-amd64/helm /usr/local/bin/ && \    rm ${HELM_FILENAME} && rm -r /linux-amd64#6- install kubectlENV KUBECTL_VERSION="v1.27.3"RUN set -x && \    curl --retry 5 --retry-connrefused -LO "https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" && \    chmod +x kubectl && \    mv kubectl /usr/local/bin/kubectl#7-install nodeRUN curl -sL https://deb.nodesource.com/setup_20.x  | bash -RUN apt-get -y install nodejsRUN npm install#8-install maven xxxxRUN mkdir -p /usr/share/maven /usr/share/maven/ref \&& echo "Downlaoding maven" \&& curl -fsSL -o /tmp/apache-maven.tar.gz https://apache.osuosl.org/maven/maven-3/xxxxbinaries/apache-maven-3.8.6-bin.tar.gz \  \&& echo "Unziping maven" \&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \  \&& echo "Cleaning and setting links" \&& rm -f /tmp/apache-maven.tar.gz \&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn# 8.1- Define environmental variables required by Maven, like Maven_Home directory and where the maven repo is locatedENV MAVEN_HOME /usr/share/mavenENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64#9-install docker daemon inside dockerRUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg |  gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpgRUN echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyRUN apt-get updateRUN apt-get install docker-ce docker-ce-cli containerd.io -y  [1]: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops#:~:text=start.sh%22%20%5D-,For%20Ubuntu%2022.04%3A,-Dockerfile

Viewing all articles
Browse latest Browse all 7144

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>