![]() The project folder will be mounted to the Docker container, and build/run/debug will be performed inside it.īy default, the project folder is mounted into the /tmp folder in the container. Alternatively, move the toolchain to the top of the list to make it default. Build, run, debug with a Docker toolchainĪfter configuring a Docker toolchain, you can select it in CMake profiles or in Makefile settings. See Docker plugin integration for description of the Services tool window and Docker-specific IDE actions. Use the Container Settings field to provide additional container settings, such as port and volume bindings: Select the Docker image and wait until the tools detection finishes. You can also configure a Docker server in Settings | Build, Execution, Deployment | Docker and then select it in the toolchain settings. For remote Docker, we recommend using remote with local sources. Out of the options listed in Connect to Docker daemon with, only the local one (first) can be used in CLion as a toolchain. Go to Settings | Build, Execution, Deployment | Toolchains.Ĭlick the gear button to the Server field to add a Docker image: This command will build the Ubuntu base image with proper toolchain dependencies. ĭepending on your platform and your Docker setup, you may need to run it using sudo. On Linux, when Docker is not rootless, CLion uses the host UID due to to file permission limitations when writing to volumes from Docker containers.Īs a workaround, you can configure the Docker daemon as rootless or create a parametrized user in the Dockerfile, for example:ĭocker build -t clion/ubuntu/cpp-env:1.0 -f Dockerfile.cpp-env-ubuntu. Here you can adjust the tools and their versions. The apt-get part installs all the toolchain dependencies into the container. The FROM ubuntu:20.04 line refers to the container's base image. In the comments at the top, you can find the commands for building the container. The example file includes the following lines and sections: You can copy this file to your project and adjust for your needs or just use it as a reference. To help you get started with Docker development in CLion, we created an example Dockerfile for the case of Ubuntu base image. ![]() To work with containers running remotely, use Remote with Gateway or Remote with local sources. Docker toolchain is not available for remote TCP and SSH connections.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |