I am trying to build a Docker image, but the same dockerfile works on a mac but not with window, so not sure if the issue is due to the OS used.Using window, I was unable to locate different packages from the requirement.txt file eventhough the text file is correctly located next to the Dockerfile within the same directory and no typo error with the file name
[ 5/25] RUN xargs -a /tmp/apt-requirements.txt apt-get install -y --no-install-recommends && apt-get clean:0.305 Reading package lists...0.987 Building dependency tree...1.102 Reading state information...1.113 E: Unable to locate package software-properties-common1.113 E: Unable to locate package aria21.113 E: Unable to locate package curl1.113 E: Unable to locate package openssl.... with the rest of packages
this the the initial part of the code:
FROM ubuntu:16.04ENV DEBIAN_FRONTEND=noninteractiveRUN useradd --create-home --home /var/lib/deploy deployADD apt-requirements.txt /tmp/apt-requirements.txtRUN apt-get -qq update -yRUN xargs -a /tmp/apt-requirements.txt apt-get install -y --no-install-recommends && apt-get clean
I was able to fix it and built the docker image, but I encountered another similar issue when running a container of the image. it says: /var/lib/deploy/run: No such file or directoryand this is the code:
ADD run /var/lib/deploy/...ENTRYPOINT ["/var/lib/deploy/run"]
I don't know what is wrong and how to fix it, if anyone could help me, I would appreaciate it a lot. Thanks.
TRIED METHODS:
I tried changing ADD
to COPY
,double checking any potential spelling errors, but none of them worked until I change the code to install each package one by one within the dockerfile instead of adding a requirement file with all of the packages, so I changed this lines:
ADD apt-requirements.txt /tmp/apt-requirements.txtRUN apt-get -qq update -yRUN xargs -a /tmp/apt-requirements.txt apt-get install -y --no-install-recommends && apt-get clean
to this:
RUN apt-get -qq update && \ apt-get install -y --no-install-recommends \ software-properties-common \ curl && \ apt-get clean# Add the rest of the apt-get requirementsRUN apt-get -qq update && \ apt-get install -y --no-install-recommends \ aria2 \ openssl \ ca-certificates \ unzip \ openjdk-8-jdk-headless \ maven \ libxml2 \ wget \ libsm6 \ libxrender1 \ libfontconfig1 \ git \ sudo \ bzip2 && \ apt-get clean
for my second issue, I tried adding FROM --platform=linux/amd64 ubuntu:16.04
, I tried changing ADD
to COPY
, I tried changing (as using window) from CRLF to LF and none of them worked.