Search code examples
dockerdockerfileshyumrhel7

How to enable yum repo inside a docker container


I need to setup nodejs,yarn inside my docker container inside RHEL7. When am using yum to install those tools, its is saying yum command not found, i realised yum itself not present in the container. please help how to create/enable yum in a dockerfile

DockerFile:

FROM selenium/node-chrome:x.xx.1.proxy
RUN yum install nodejs

Expected Result: Nodejs should be installed Actual Result:

Step 2/8 : RUN yum install nodejs
 ---> Running in 0d8e2ca0fb33
/bin/sh: 1: yum: not found
The command '/bin/sh -c yum install nodejs' returned a non-zero code: 127

Please help in resolving the issue by setting up yum in docker container


Solution

  • Yum is a Red Hat tool, but selenium/node-chrome is based off ubuntu. Use apt-get instead.