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 ?

  • Docker automated build Error: Build failed: Dockerfile not found at ./Dockerfile
  • How to prevent zombie services with consul and gliderlabs/registrator?
  • What is the optimal way to store data-files for testing using travis-ci + Docker?
  • How to set hwaddr in docker 0.9.x
  • How to cache the RUN npm install instruction when docker build a Dockerfile
  • “Invalid configuration for registry” error when executing “eb local run”
  • 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.

  • Xdebug with PHPStorm and a Docker container
  • Docker Symfony 1.4 strange missing “/” error
  • Docker-compose running container
  • Boto3 SQS Intermittent AccessDenied
  • Docker cannot link to a non running container - fixed with a reboot
  • Use RubyMine and Docker for development
  • 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/ -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.