shuhaoliu / docker-clion-dev Goto Github PK
View Code? Open in Web Editor NEWDebugging C++ in a Docker Container with CLion IDE
Debugging C++ in a Docker Container with CLion IDE
I want to use clion on win10 with Remote Docker Container debugging Env(OpenCV 4) Of Ubuntu 18.04.I install Docker in my local machine(win10). Thanks to https://github.com/shuhaoliu/docker-clion-dev, I use your Dockerfile and yml file:
It works well with many C++ library,but I want to use OpenCV4 Library,I want to run this CPP file:
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char* argv[]) {
Mat src = imread("/code/001.png");
if (src.empty()) {
printf("cannot load images!\n");
return -1;
}
namedWindow("show_photo", WINDOW_AUTOSIZE);
imshow("show_photo", src);
return 0;
}
It shows that: **(show images:314): Gtk-WARNING : 09:56:09.309: cannot open display:
I found some information,But they are all about entering the command line, how to modify the dockerfile and yml file?? Please master programmers help me!
My IDE is Clion on Win10,I already install Xming on win10 and knows the X0.hosts .
Thanks for sharing your setup, it's really helpful.
I have the above two questions regarding CLion configuration, from this part of the README:
https://github.com/shuhaoliu/docker-clion-dev#usage
Check the file mapping settings in Clion. Before each run, code will be rsync-ed to the container at a temporary location.
How should you configure the local and "remote" mapping for local debugging (source is on your dev machine)? (Partially answered in #4)
Is there a way to avoid rsync-ing, considering the source is already on the local dev machine?
I am not sure what the deployment path should be. Should it also be /home/debugger
CMakeLists.txt has cmake version 3.13 as a dependency, but currently Cosmic supports 3.12.1-1
I discovered that this line in the Dockerfile works:
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
However, for me the entry in the /etc/ssh/sshd_config file itself is still commented out (not sure if it's always a problem) and as a result still gets "access denied" when trying to SSH as root. i.e.:
$ grep -i "PermitRootLogin yes" /etc/ssh/sshd_config
#PermitRootLogin yes
An easy fix is to either update the existing sed
command or add a second sed
command such as:
RUN sed -i 's/#PermitRootLogin/PermitRootLogin/' /etc/ssh/sshd_config
If the entry is not commented out, the secondary sed
command has no effect. Then I was able to successfully SSH once the file looked like this:
$ grep -i "PermitRootLogin yes" /etc/ssh/sshd_config
PermitRootLogin yes
Mostly posting here in case anyone else runs into this. I will submit a PR if I get a chance. Thanks!
Hello
Firs of all thanks for writing down this great solution :)
I have a lot of problems with "Deployment" sometimes files not uploaded etc. (Check options under "Deployment" to fix that)
So I'm building using local docker so I thought that I can reuse mounted path in docker instead transferring code to /tmp via SFTP.
I just added code path in exclude paths. So this way it won't transfer extra data to generate cmake-build folder.
Seems to work...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.