Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

installing a GCC compiler onto a Docker Container

Tags:

docker

gcc

I am trying to install mono package onto a Docker container, but mono requires git , autoconf, libtool, automake, build-essential , mono-devel, gettext packages.

the problem I am having is that libtool requires libc-dev, and libc-dev requires gcc compiler.

The docker container does not have any compiler installed, but my local machine does.

arcolombo@acolombo:~/Documents/bedgraph_dockerfile$ dpkg --list |grep    compiler ii  g++                                                                 4:4.8.2-1ubuntu6                                    amd64        GNU C++ compiler ii  g++-4.8                                                     4.8.2-19ubuntu1                                     amd64        GNU C++ compiler ii  gcc                                                         4:4.8.2-1ubuntu6                                    amd64        GNU C compiler ii  gcc-4.8                                                     4.8.2-19ubuntu1                                     amd64        GNU C compiler ii  hardening-includes                                          2.5ubuntu2.1                                        all          Makefile for enabling compiler flags for security hardening ii  libllvm3.5:amd64                                            1:3.5-4ubuntu2~trusty2                              amd64        Modular compiler and toolchain technologies, runtime library ii  libmono-compilerservices-symbolwriter4.0-cil                   3.2.8+dfsg-4ubuntu1.1                               all          Mono.CompilerServices.SymbolWriter library (for CLI 4.0) ii  libxkbcommon0:amd64                                         0.4.1-0ubuntu1                                      amd64        library interface to the XKB compiler - shared library ii  mono-mcs                                                    3.2.8+dfsg-4ubuntu1.1                               all          Mono C# 2.0 / 3.0 / 4.0 / 5.0  compiler for CLI 2.0 / 4.0 / 4.5 

so my question is , what is the easiest way to get a gcc compiler onto a Docker container? should I just create a volume of these compiler directories into my docker container?

The reason I think I may need it is because I am running a website, and the website executes a docker image directly.

like image 657
sophie-germain Avatar asked Apr 19 '15 17:04

sophie-germain


People also ask

Which command is used to install GCC compiler?

sudo apt install GCC Type 'y' when the command prompt asks “Do you want to continue?” and then press Enter.

Can I run GNS3 on Docker?

GNS3 IntegrationDocker support is a new feature of GNS3 version 1.5. The goal is not to simulate the deployment of a container infrastructure in production but use containers as light virtual machines replacing heavy Qemu VMs or VPCS when tools like telnet, nmap etc. are needed.


1 Answers

In your Dockerfile:

FROM ubuntu # ... ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && \     apt-get -y install gcc mono-mcs && \     rm -rf /var/lib/apt/lists/* 
like image 101
Vitaly Isaev Avatar answered Sep 21 '22 22:09

Vitaly Isaev