skip to Main Content

I have following commands, How can I make a docker file from this

docker run -ti -dP --name centos -v /c/Users:/mnt/Users centos:latest /bin/bash
docker start centos
docker attach centos
curl -sL https://rpm.nodesource.com/setup | bash -
yum install -y nodejs

Please help to create a dockerfile from this

2

Answers


  1. FROM centos:8
    RUN curl -sL https://rpm.nodesource.com/setup | bash -
    RUN yum install -y nodejs
    

    Note that you can’t mount volumes when building, you’ll need to copy in files with the COPY command (https://docs.docker.com/engine/reference/builder/#copy).

    Login or Signup to reply.
  2. FROM centos:8
    COPY /mnt/Users/* /bin/bash/
    RUN curl -sL https://rpm.nodesource.com/setup | bash -
    RUN yum install -y nodejs
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search