Sign inSign up

code4clouds/docker_cpp

By code4clouds

•Updated almost 7 years ago

A Docker container to build C++ projects.

Image
0

10K+

code4clouds/docker_cpp repository overview

⁠Docker_CPP

⁠Description

Docker file to compile C++ code

⁠Build Container

docker build -t docker_cpp -f Dockerfile-development .

⁠Run Docker Container Environment

This docker will commmand will mound the current directory insside the /build directory. The reason to mount the directory is to keep the compiled binery in the host OS.

⁠On Windows
docker run -v "c:\build:/build" docker_cpp
⁠On Linux
docker run -v "/src:/build" docker_cpp

⁠Compiling your code

Once inside the bash file execute

g++ helloworld.cpp

⁠Run you code

./a.out

⁠Cleanup

exit

The a.out file will stay on your host OS after the container exits.

Tag summary

Content type

Image

Digest

Size

155.7 MB

Last updated

almost 7 years ago

docker pull code4clouds/docker_cpp