[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-dev] Building CDT project with docker image
|
- From: Moritz Strübe <moritz.struebe@xxxxxxxxxx>
- Date: Wed, 10 Feb 2021 16:24:37 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mathema.de; dmarc=pass action=none header.from=mathema.de; dkim=pass header.d=mathema.de; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qOXbadUbiTiS92S25MFX6zALRpp2vc2fInyhCbYYD5Y=; b=lxhTeCQapw2LYZkZhGcAJfaABLKhHPyXoWWBvJ5+j3WoLdDicaGPEmdFwokg/iS+EO5oyfBOlG6HNXLh5kvDOmOf9qjKtVjb+Q++5uVxFphVVWBeh6l5+V3WDhBl155dpRTTSc7W1Ktdhu2x/t7vC0IIbrBoOK+/htcR0j1r76UryC0xtlxmd6ymOvjRM48eTlwnIyS/s0VeQvH+4enuxr1aTzyhiLxRtkuizcTiGNfFbrnswJRDQp3w0QpegY786d4t4y+PR9GhAhK5kDvoo5HbVSdeJTHojKjTo0ZGscz5YIkFl25cBlSPzcPVeruOoo1KFPECO2da/eBtAE1LvA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n5zseJ+YDpeNbBiPwHIHjPURfUciJWeWbj5VvDYWjvMsdlJ79BX+s4UvJAM6w5fCZEHkT1q/gAVQTwGj+ODf8Hl/04JvFCn20Y4bLPaw4uK/kM9n/o0lx7p4kHza+khu72O9xlPPcEtE47wxnGx1HOuKO5nQ08tqkuo1tgM/vZnHNsRnEAUUMIT7TGhfFm84W8L6arrvsaJPFkIGTAN/QOS3hb08UiNPhlUS9Q+UUnACbhXpmd+M4n+2T7DwU4AS3ud5EstZqUljEpxpdm+SS9+kSffm1ngIxyaXW1MOL615nX/sS602UX8W2Pc8QRzWcQCYjmkvzH2zvPtnZ9TMiQ==
- Delivered-to: cdt-dev@xxxxxxxxxxx
- List-archive: <https://www.eclipse.org/mailman/private/cdt-dev/>
- List-help: <mailto:cdt-dev-request@eclipse.org?subject=help>
- List-subscribe: <https://www.eclipse.org/mailman/listinfo/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=subscribe>
- List-unsubscribe: <https://www.eclipse.org/mailman/options/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=unsubscribe>
- User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1
Hey,
you are running into a classical Docker-Issue: No user-mapping for
bind-mounts. For Windows this does not matter, because the folders
are shared via some (pretty slow) abstraction layer and are mapped
to the appropriate user. When you run your code using Linux, the
user within the Docker is either root, which has user id 0, or some
created user, which most likely has user id 1000. If you run your
code using the root user, all created files belong to root and there
are some scripts that don't run as root (mostly for safety reasons).
If you run as user with the ID 1000 you won't have access to the
files, as the Linux user who owns the files most likely has a
different user-id.
VSCode solves this by changing the user-id of the default user after
startup.
There are two quick solutions, besides adding support to Eclipse:
* Make sure the user with id 1000 has access to the files. Something
you can do on your own system, but is not something you want to
support for other people.
* Use root within the docker-image, pass the user-id of the
linux-user into the container. Then, in the entrypoint, create a new
user with that user-id and change to that user. I however did not
research the best way to pass the user-id into the container.
* Similar to the latter, but detect the user-id based on the owner
of the the current work-directory.
Cheers
Morty
Am 10.02.2021 um 15:59 schrieb Alexis
Bouffies:
Hi everyone,
I am running into issues when using the
“Build from Docker image” option for the CDT project build. My
use case is the following:
I have a custom RCP based on Eclipse CDT.
This RCP had been ported to Windows, and we are trying to port
it to Linux Ubuntu. To build C/C++ projects, we deliver a
Docker image to the user, that is linked at project creation.
The project is built through a “make” command. We also offer
the possibility to build the project in the Docker image in
command line mode. Here is what I have so far:
- In
Windows everything works, build in the Docker image from CDT
or in Docker from the launched image in the command line
- In
Linux Ubuntu, the whole build works fine from the command
line, but I witnessed the following issues when building from
CDT:
o I
got some “permission denied” errors when calling the compiler
installed on the Docker image. Although this has been solved
setting the user to “root” when building the Docker image, it
makes me wonder what the user is set to when running from CDT?
o After
setting the user to root in the built Docker image, another
issue appears: we have a python tool installed in the Docker
image, and when this tool is called by the make script from
the Docker image inside CDT, nothing happens, it seems the
tool cannot even be called.
I do not have extended experience with
Linux so there is probably something I am missing there. Any
help would be greatly appreciated.
Thanks,
Alexis
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdt-dev
--
MATHEMA GmbH
Schillerstraße 14 | 90409 Nürnberg
Telefon: +49 (0)911 180778-50
E-Mail: moritz.struebe@xxxxxxxxxx | Web: www.mathema.de
Geschäftsführer: Andreas Hanke, Thomas Haug
Handelsregister: HR B 35517, Nürnberg/Bayern