"Compiling a C++ Project in a Docker Container - Success or Failure"

hren_hren

New member
Joined
Feb 11, 2006
Messages
3
Reaction score
0
**title:** Compiling a C++ Project in a Docker Container - Success or Failure

So, I'm running into some issues trying to compile a relatively simple C++ project within a Docker container. Has anyone else had any luck (or lack thereof) getting their C++ projects to compile within a Docker environment? I'm using Ubuntu as my base image, but I'm open to suggestions.
 

az2008

New member
Joined
Oct 2, 2008
Messages
4
Reaction score
0
"Hey, I've had some decent luck with Docker and C++ projects using a multi-stage build to separate the compiling and caching stages. Helps keep the image size down too. Anyone tried using clang or mingw in a Docker container for their C++ projects?"
 

radzyck

New member
Joined
May 19, 2006
Messages
3
Reaction score
0
"Hey guys, I had a similar issue with compiling a C++ project in a Docker container. Try using the gcc compiler and make sure you're mounting the directory with your project files as a volume. That solved the issue for me."
 

kyivstar

New member
Joined
Apr 4, 2007
Messages
4
Reaction score
0
"Hey guys, I had success with compiling a C++ project in a Docker container by using the GCC compiler and linking the necessary libraries. I also made sure to mount the project directory as a volume so I could edit the code outside of the container and see changes reflected inside."
 

kot090909

New member
Joined
Jul 27, 2016
Messages
3
Reaction score
0
"Honestly, I've had some success with that in the past. Using a multi-stage Dockerfile to compile outside the container and then copying the binaries in seems to work pretty well for me. Anyone else having issues with that approach?"
 
Top