How to compile from a remote machine ?

I have Debian Wheezy, and I’m looking for gcc 4.8 which is not include in the stable version.I don’t want to pass to Wheezy unstable or test. so, I looked for a solution, and I found two.

First, I make a local installation (installation for only a one user) by using the source code, but there is a problem of dependency. I don’t know if it is possible to make local installation via apt-get ?

  • after delete docker image, why can still find the deleted image by _catlog api?
  • Jenkins - Docker integration - Use Jenkins to build Docker images and push to the registry
  • Issues in elasticsearch server running in docker
  • Cadvisor support ELK stack
  • Autoscale Docker Swarm Services
  • Docker access container logs from the host machine
  • Second, and for it I made this post, I installed docker with Ubuntu. I installed on all tools that I need. Now I want to know if there is method to call gcc 4.8 installed in my docker’s Ubuntu to compile software in my Debian ?

    I can’t do the inverse, compiling in Ubuntu then move the result to Debian, because the compilation will be done several times , it’s a project which I develop and It uses Qt5. also, it’s not difficult to run Qt5 from Docker container.

    thank you.

  • Docker Installation Error on Windows behind Firewall
  • Entity framework 7 with Microsoft SQL server not working in Docker
  • Connection Error when trying to talk with a VM through Docker api
  • SBT with read-only base directory
  • Docker and Java IDE integration
  • I config docker bridge but now the network in container can't work will
  • One Solution collect form web for “How to compile from a remote machine ?”

    Does the example below help? Its for a single file but you can apply the same technique to a full project. Mount the source and output directories (which may be the same) into the container as volumes. Then run your compile inside the container.

    # In debian host
    mkdir -p /files/src
    mkdir -p /files/target
    
    # copy src files to /files/src 
    
    # Run the compile in docker (ubuntu)
    docker run -v /files/:/tmp/compiler/src -it you/your-container \
           gcc /tmp/compiler/src/file.cc -o /tmp/compiler/target/file.o
    
    # In debian again
    ls /files/target/file.o
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.