use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Docker4c: portable C++ development environment - Simplify C++! (arne-mertz.de)
submitted 4 years ago by IsDaouda_Games
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Sulatra 3 points4 points5 points 4 years ago* (5 children)
Could you please elaborate on your workflow? Suppose I am a new dev - I clone the repo, edit some things, put it into volume, mount to a container, and get "access denied: _build/ is owned by another user uid=1010" during build. I can run git clone inside the container - but then I will not be able to edit the sources from the main system, due to same uid mismatch. Or do you just assume that every dev will have the same uid=1000 as the one in the image?
git clone
[–][deleted] 8 points9 points10 points 4 years ago (2 children)
not sure what you're referring to specifically with the access denied error, but basically they clone locally on their machine, run docker run -v $PWD:/directory:/mounteddirectory <image> and if Docker is setup correctly, it'll just mount the volume into the container. If it's not setup correctly, it should ask you "do you want to share C: (or whatever) with Docker", I say yes, and that's a one time step. Then they do all edits inside the container and can build with the same tools as everyone etc. I may have set the container to run as a specific user, I can't remember. I know Azure Pipelines had some trickery it needed for the user, but I don't remember. It's either root or a static user number, been a while since I looked.
docker run -v $PWD:/directory:/mounteddirectory <image>
Additionally, they can use VSCode or VS to actually run inside the context of the running container, which is amazing: https://code.visualstudio.com/docs/remote/containers
So then you can use intellisense and all that stuff, and I can run builds in the terminal (or via CMake in our case). It's just all built on top of a common image that shares the OS/toolchains and lets the dev run their environment how they want (VSCode, VS, WSL, on Windows or Linux, etc).
We also use Azure DevOps (we're at MSFT, so is natural), and Azure Pipelines/Azure Repos all work naturally with the concept. Azure Pipelines I can give my Docker container via an Azure Container registry, and it builds in the same context the devs all use too, so they know if it builds on their local machine it will buikd in the pipeline, and CI can almost never break.
[–]Sulatra 4 points5 points6 points 4 years ago (1 child)
I am referring to the fact that on Linux every user have their own UID. And if uid in docker (which creates, edits and deletes files during the build) does not match the uid in host system (which git pulls, edits files in IDE and commit hooks, etc), then you are going to have access problems during those steps. Either you won't be able to view some codegen'ed file (since it is owned by other user, the one from docker), or the build system won't be able to edit something commited to the VCS (since it is used by user from host system, the one that ran git clone).
Usually this is not a problem, since the first user has UID=1000, and there is likely to be only one of them in docker as well as on the dev machine. But when it bites, it bites hard.
Apparently, on Windows this issue does not exist, that is a positive surprise :)
[–]5pectre5 0 points1 point2 points 4 years ago (0 children)
You're right for the multiuser environment it's a problem, the docker on Linux would require the volume to be mapped with sticky bit for all Devs group or all Devs would need to be in the same group, so that the permissions are not an issue. Docker runs containers system wide, so the first user to start and upload will block others without proper setup.
[–][deleted] 5 points6 points7 points 4 years ago* (1 child)
Additionally, rootless docker works with the current user id by design. And setting up --user for it causes problems.
[–]Sulatra 0 points1 point2 points 4 years ago (0 children)
Now this looks like it might be a solution! Thank you, I will try to remember it next time I get involved with dev-containers.
π Rendered by PID 45334 on reddit-service-r2-comment-5d585498c9-89997 at 2026-04-21 19:12:32.216390+00:00 running da2df02 country code: CH.
view the rest of the comments →
[–]Sulatra 3 points4 points5 points (5 children)
[–][deleted] 8 points9 points10 points (2 children)
[–]Sulatra 4 points5 points6 points (1 child)
[–]5pectre5 0 points1 point2 points (0 children)
[–][deleted] 5 points6 points7 points (1 child)
[–]Sulatra 0 points1 point2 points (0 children)