Dockerfile:
FROM continuumio/miniconda:latest
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get --allow-releaseinfo-change update && apt-get upgrade -y && apt-get install -qqy \
wget \
bzip2 \
graphviz \
curl
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs && apt-get install -y npm
RUN mkdir -p /backend
COPY ./backend/requirements.yml /backend/requirements.yml
RUN /opt/conda/bin/conda env create -f /backend/requirements.yml
ENV PATH /opt/conda/envs/dacheting_backend/bin:$PATH
RUN echo "source activate dacheting_backend" >~/.bashrc
RUN mkdir -p /scripts
COPY ./scripts /scripts
RUN chmod x ./scripts*
COPY ./backend /backend
RUN mkdir -p /frontend
RUN mkdir -p /frontend_tmp
COPY ./frontend /frontend_tmp
WORKDIR frontend_tmp
RUN npm i
RUN npm run build
WORKDIR /backend
and when I try to run docker build -t xxxx:latest .
I get the following error:
ERROR [ 3/18] RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y 52.2s ------ Depends: node-write-file-atomic (>= 2.3~) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
(I get alot of other "Depends: .... but it is nog going to be installed" as well)
--
I've tried looking for solutions and used different aspects but nothing worked.
CodePudding user response:
I tried with this version with a few minor changes:
FROM continuumio/miniconda:latest
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
RUN apt-get update --allow-releaseinfo-change \
&& apt-get install --assume-yes --no-install-recommends --quiet \
curl \
lsb-release \
gnupg \
&& apt-get clean all
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install --assume-yes --no-install-recommends --quiet \
nodejs
and found no problem.
Output:
$ docker build -t stackoverflow -f Dockerfile.curl
STEP 1/5: FROM continuumio/miniconda:latest
STEP 2/5: ENV LANG=C.UTF-8
--> Using cache f8fc7d943e2c988c66c1048d2524de30c010244b02390f561aae07e234a924bf
--> f8fc7d943e2
STEP 3/5: ENV LC_ALL=C.UTF-8
--> Using cache b6df639a53a673fda399433b9771b04463c232b7f6b59510ac7dc9e0db8c9cb9
--> b6df639a53a
STEP 4/5: RUN apt-get update --allow-releaseinfo-change && apt-get install --assume-yes --no-install-recommends --quiet curl lsb-release gnupg && apt-get clean all
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
[...]
STEP 5/5: RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install --assume-yes --no-install-recommends --quiet nodejs
## Installing the NodeSource Node.js 14.x repo...
## Populating apt-get cache...
apt-get update
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Reading package lists...
## Confirming "buster" is supported...
curl -sLf -o /dev/null 'https://deb.nodesource.com/node_14.x/dists/buster/Release'
## Adding the NodeSource signing key to your keyring...
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
## Creating apt sources list file for the NodeSource Node.js 14.x repo...
echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' > /etc/apt/sources.list.d/nodesource.list
echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' >> /etc/apt/sources.list.d/nodesource.list
## Running `apt-get update` for you...
apt-get update
Hit:1 http://deb.debian.org/debian buster InRelease
Hit:2 http://security.debian.org/debian-security buster/updates InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Get:4 https://deb.nodesource.com/node_14.x buster InRelease [4584 B]
Get:5 https://deb.nodesource.com/node_14.x buster/main amd64 Packages [768 B]
Fetched 5352 B in 1s (3748 B/s)
Reading package lists...
## Run `sudo apt-get install -y nodejs` to install Node.js 14.x and npm
## You may also need development tools to build native addons:
sudo apt-get install gcc g make
## To install the Yarn package manager, run:
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 62 not upgraded.
Need to get 25.0 MB of archives.
After this operation, 122 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_14.x buster/main amd64 nodejs amd64 14.18.1-deb-1nodesource1 [25.0 MB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 25.0 MB in 6s (4055 kB/s)
Selecting previously unselected package nodejs.
(Reading database ... 13510 files and directories currently installed.)
Preparing to unpack .../nodejs_14.18.1-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (14.18.1-deb-1nodesource1) ...
Setting up nodejs (14.18.1-deb-1nodesource1) ...
COMMIT stackoverflow
--> c9d22106329
Successfully tagged localhost/stackoverflow:latest
c9d2210632965f49408570dd2808cf8dfbe50d19ffce58972865a9a9e0a6d93b