Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22016

How to install git and gcc-c++ through Dockerfile?

$
0
0

I have CentOS VM on which I have installed git and gcc-c++ using CentOS Linux commands:

sudo yum install git
sudo yum install gcc-c++ 

and everything works smoothly now I want to do this through Dockerfile.

Now my question is I am creating a Dockerfile and I want to run these commands then how to do it? Am I doing it right? I need gcc-c++ for my following make (C prog) command to work. Here's my Dockerfile:

FROM centos
FROM gcc

COPY . /usr/src/standOff-surveillance

WORKDIR /usr/src/standOff-surveillance


RUN touch Version.c
RUN sudo yum install gcc-c++ 
RUN sudo yum install git

RUN make clean
RUN make

RUN ./StandoffSurveillance

and I am getting the following error:

 ---> 3dfc8768767f
Step 6/10 : RUN sudo yum install gcc-c++
 ---> [Warning] IPv4 forwarding is disabled. Networking will not work.
 ---> Running in 94da8b0ddefb
/bin/sh: 1: sudo: not found
The command '/bin/sh -c sudo yum install gcc-c++' returned a non-zero code: 127

So how to install gcc-c++ and git because they need to be there for running make command. Please help me.

Can I use centos which I mentioned in my dockerfile to run it and install those linux install commands on it?


Viewing all articles
Browse latest Browse all 22016

Trending Articles