[SOLVED] (Trial version) Run as non-root user inside Docker

The answer can be found at [SOLVED] (Trial version) Run as non-root user inside Docker - QCAD 'How Do I' Questions - QCAD Forum



Hi everyone,

Thank you for hosting this forum. I will try and describe my problem as best I can in the hopes someone has had a similar issue (and a solution).

QCAD version:

./qcad -platform offscreen
QCAD version  3.26.1

Linux details:

uname -m
x86_64

I can add more details when and if required.

I’ve downloaded the following file https://qcad.org/archives/qcad/qcadcam-3.26.1-trial-linux-x86_64.run from QCAD - Download

I use Docker to spin up (albeit temporary) servers. I use a PHP-CLI user (non-root) as default via docker-compose. The following command is used to execute commands inside Docker:

docker-compose exec php-cli bash

After that I used chmod +x to make the .run-file executable and ran it successfully.

I’ve ran the following command as non-root user without it actually creating a PDF file:

./dwg2pdf -a -c -k -f -platform offscreen /path/to/file.dwg

It runs the program but never stores the PDF file in /path/to/file.pdf. When I run the same command as root user it does create a PDF file.

How can I run the (trial) program to successfully create a PDF file as a non-root user?

Thank you for your time.


Tom de Wit

You would have to make sure that said user has write access to the output directory.

Also, keep in mind that if you have previously created a file as root, that file might not be overwritable by a regular user.

I’ll try again and attempt to write to my own “home” directory. I’ll report back.

I’m happy to report this works. I was under the impression the tmp folder was mine. My mistake, entirely!

Hi Andrew, could you please verify the following with me?

Why would the following code work:

dwg2pdf -platform offscreen -a -c -f -k storage/framework/testing/disks/local/test.dwg

But not this:

dwg2pdf -platform offscreen -a -c -f -k storage/framework/testing/disks/local/test.dwg -o storage/framework/testing/disks/local/test.pdf

I can guarantee that the PDF file is, in fact, generated with the first example command but the error that’s generated in the second command is:

Cannot import file: /var/www/html/storage/framework/testing/disks/local/test.pdf

The response on the first example is:

Converting
from: /var/www/html/storage/framework/testing/disks/local/test.dwg
to  : /var/www/html/storage/framework/testing/disks/local/test.pdf

The last parameter is always the input file. So:

dwg2pdf -platform offscreen -a -c -f -k -o storage/framework/testing/disks/local/test.pdf storage/framework/testing/disks/local/test.dwg

It’s right there in the description…

Usage: ./dwg2pdf [OPTIONS]... <drawing file>

from QCAD - QCAD Command Line Tools

Thanks, it seems to work as intended now.