I don’t have any Ubuntu machines enabled with internet and I have requirement to have a docker image ready with some basic softwares enabled as this need to be configured as our Azuredevops build agent.
So in order to work my Dockerfile , I used one of aksnode itself to build my docker image as there I could see some of the apt-get commands working somehow (may be with default internet connectivity enabled there for aks functionalities).
Below is the source.list content of aks node and I tried to copy the same to my Ubuntu based Dockerfile
deb http://azure.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://azure.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://azure.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://azure.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://azure.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://azure.archive.ubuntu.com/ubuntu/ bionic universe
deb http://azure.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://azure.archive.ubuntu.com/ubuntu/ bionic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://azure.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://azure.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://azure.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://azure.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://azure.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://azure.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner
deb http://azure.archive.ubuntu.com/ubuntu/ bionic-security main restricted
# deb-src http://azure.archive.ubuntu.com/ubuntu/ bionic-security main restricted
deb http://azure.archive.ubuntu.com/ubuntu/ bionic-security universe
# deb-src http://azure.archive.ubuntu.com/ubuntu/ bionic-security universe
deb http://azure.archive.ubuntu.com/ubuntu/ bionic-security multiverse
# deb-src http://azure.archive.ubuntu.com/ubuntu/ bionic-security multiverse
After copying the same file to my Docker image build step as below.
COPY ./sources.list /etc/apt/
I could successfully install the basic software’s like, curl wget, jq, git, python, etc…
But I am not able to install softwares like, AzureCLI, Docker, dockerce-and nodejs, chrome-headless, etc..
My dockerfile parts for them as below as below.
#4-Install AzureCLI
RUN curl -LsS https://aka.ms/InstallAzureCLIDeb | bash
&& rm -rf /var/lib/apt/lists/*
#7-install node
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -
RUN apt-get -y install nodejs
RUN npm install
#9-install docker daemon inside docker
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
RUN echo
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update
RUN apt-get install docker-ce docker-ce-cli containerd.io -y
where all I am getting the error as below
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to
So looking for a way to get succeeded with all the above softwares installed without internet or do we have any azure archive repo for the same like other softwares enabled?
3
Answers
Try this
Try this
Why add this in a container image ? Install a docker inn a container image ?
RUN apt-get install docker-ce docker-ce-cli containerd.io -y
Another method to provide install deb is:
In a Ubuntu machine, can access internet,
#9-install docker daemon inside docker
run:
run:
run:
run:
run:
run
Now you can COPY /var/cache/apt/archives/*.deb TO Your VM1 (no internet0
and install deb files.
2022/12/05 update
do all steps in docker containers
copy ~/WK/data to INTRANET MACHINE ~/WK/data
solution 3: use apt-offline
You need two machines, one connected (VM-INTERNET), one offline (VM-HOSTONLY), both machines need to install apt-offline.
If you want to execute
apt update
.You have to perform the following steps:
If you want to execute
apt-get upgrade
You have to perform the following steps:
If you want to execute
apt-get install
You have to perform the following steps:
Please note that VM-HOSTONLY$ indicates that this instruction is executed on a VM-HOSTONLY machine; VM-INTERNET$ indicates that this instruction is executed on a VM-INTERNET machine.
The result file generated by the execution process, such as xxx.sig , or xxx.zip needs to be copied to the corresponding machine by yourself.
But at least it can package multiple related deb files into a zip for easy copying and delivery.
It is recommended that you test all the required files in the VM environment first, and then prepare these zip files for docker.