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 ?

  • What is the Docker security risk of /var/run/docker.sock?
  • The easiest way to config docker container log to specific file
  • .ebextensions with Docker on elasticbeanstalk
  • Is it possible to create named volume via Dockerfile during docker build?
  • Update max_map_count for ElasticSearch docker container Mac host
  • How do you iteratively develop with docker?
  • 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 OSX: Connect to a host port from a container
  • Can docker compose skip build if the image is present?
  • Docker container A dies after excuting query(insert/update) in cassandra running as another docker service B
  • Health Check command for docker(1.12) container (Not in Dockerfile!)
  • How install the Amazon ECS Container Agent in Debian? (ecs-init)
  • Access to a docker container on Heroku
  • 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.