Reputation: 43
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 ?
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.
Upvotes: 0
Views: 125
Reputation: 18649
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
Upvotes: 1