Lucee code obfuscation under docker

Your code assumes there’s :/opt/lucee/web/cfclasses/ exists in Ubuntu box and map it to the newly created directory named “compiled” under current directory, correct?
My Ubuntu box does not have /opt/lucee/web/cfclasses directory
no /opt/lucee in the first place.

Code runs, it create a docker instance, however, the “compiled” directory is still empty.
Probably I’m missing something here.

Or the above steps are necessary, then, I use this instance, upon its usage, the “compiled” directory would be populated?

supposed so, I created the following docker instance for it:

docker run --rm -d --name compiler -p 8887:8887 -v $PWD/mydirX:/opt/lucee/web/cfclasses/ lucee/lucee4

docker ps indicates its up and running

 8080/tcp, 0.0.0.0:8887->8887/tcp   compiler

however, the 8887 port is not accessible from the web browser.

In addition, currently I have one docker app running and web accessible, I won’t touch this guy, see below for its port mapping

 8080/tcp, 0.0.0.0:8888->8888/tcp   prodapp1

How to make this new docker instance web accessible? That is, how do we fix the tcp port mapping?

Thanks.

a) You would create it, or substitute with a file you’d want to copy.
b) Yes, you are.

Had you referred to my detailed message and looked at the Dockerfile, you’d see Line 1 is:

FROM tomcat:8.0.53-jre8

1 Like

Incorrect.

$PWD/compiled is on the HOST, /opt/lucee/web/cfclasses/ is in the CONTAINER

Reread my detailed message. Reread the lucee4 container docs.

Folder locations
Web root for default site: /var/www

Configuration folders:

Tomcat config: /usr/local/tomcat/conf
Lucee config for default site: /opt/lucee/web
Lucee server context: /opt/lucee/server/lucee-server/context
Log folders:

Tomcat logs: /usr/local/tomcat/logs
Lucee logs for default site: /opt/lucee/web/logs

You need to determine where the cfclasses folder is. And pull the files from there.

If all else fails, export the container as a tar and find it. i.e. docker export compiler |tar -tvf - and look for cfclasses, and all your compiled class files.

For that matter you can just extract them from the tar.

You… fix the tcp port mapping.

It’s listening to 8080 INSIDE the container. So you want -p 8888:8080 or -p 8887:8080

Or if 8888 is the port inside the container you need, use -p 8887:8888

@joe.gooch sorry, let me take baby steps…

executed the following two commands:

docker create --name temp lucee/lucee4
docker export temp | tar -tvf -

executed
ls /usr/local/tomcat

result:

cannot access '/usr/local/tomcat': No such file or directory

docker exec -it temp sh
ls /usr/local/tomcat

Review the basics:
https://lucee.daemonite.io/t/file-write-permissions-on-lucee-docker-image/5088

docker exec -it temp sh

resulted in
“Error response from daemon: Container 06d59b1e3f038a2b8909480f58318c2dae2c181049708d9ca833981370835fa1 is not running”

Ok. Stop using my temp example.

Get your container to work.

docker run --rm -d --name compiler -p 8887:8888 -v $PWD/mydirX:/opt/lucee/web/cfclasses/ lucee/lucee4

Then:

docker exec -it compiler sh
ls -l /opt/lucee/web/
ls -l /usr/local/tomcat

You have to be IN the container to see container paths.

docker export compiler |tar -xvf -
will also show you every file in your container.

1 Like

@joe.gooch progress, many thanks.

ls -l /opt/lucee/web/cfclasses

total 0

ls -l /usr/local/tomcat/webapps/

total 0

// comment
they are/were available upon entering a “sub shell” (not sure what’s the exact term).

I then copy /var/www/mydir to /var/www/mydirX (recursively).

then web browser error:
Page /mydirX/login2.cfm [/var/www/mydirX/login2.cfm] not found

But both the /lucee/www/mydirX directory and the /var/www/mydirX directory has the login2.cfm file.

what do I need to do to fix it?

Much appreciated.