Message Boards

Liferay 7.3 DXP with Docker: permission error

thumbnail
Alessandro Candini, modified 2 Years ago.

Liferay 7.3 DXP with Docker: permission error

Regular Member Posts: 130 Join Date: 10/17/15 Recent Posts

Hi everyone, I'm getting the following error running a Liferay 7.3 DXP with Docker:

cp: can't create '/mnt/liferay/deploy/trial-dxp-license-1624926383000.xml': Permission denied

Because the temporary license is not deployed correctly, at the end of Liferay startup, at http://localhost:8080 I get the "missing license page", and not the Liferay Home as expected.

 Here's my steps:

  • I've used the latest version available of blade (4.0.9.202107011607) to create a workspace:
    blade init -v dxp-7.3-sp1 --product dxp lfr-wp
  • version dxp-7.3-sp1 is the latest provided by blade, but we've already got a 7.3.10-dxp-2 on Docker Hub, so I've configured the following property inside gradle-local.properties to get the latest docker image:

    liferay.workspace.docker.image.liferay=liferay/dxp:7.3.10-dxp-2
  • next, I pulled the image, started the container and visualized logs, from wich I get the error reported above:
     
    blade gw pullDockerImage && blade gw startDockerContainer && blade gw logsDockerContainer

 

Maybe this issue is due to the fact that inside the container, permission for the /mnt/liferay/deploy directory are not for liferay user:

docker exec -it lfr-wp-liferay bash

liferay@4ea428acd362 /opt/liferay 
$ ls -l /mnt/liferay/
total 12
drwxr-xr-x    2 45141307 45141322      4096 Aug 12 07:26 deploy
drwxr-xr-x    2 liferay  liferay       4096 Aug 12 07:26 patching
drwxr-xr-x    2 liferay  liferay       4096 Aug 12 07:26 scripts

As a workaround, I've added to the Dockerfile.ext the following line, in order to perform the license deploy as user administrator inside the container:

USER root

That worked: the licence is deployed, error do not shows up and I get the correct Liferay Home Page at http://localhost:8080, but I do not thik this is the correct approach, I would like to avoid using the root user.

Furthermore, I've created deploy and scripts directories at the top level of my liferay workspace, but unlike what is said in the documentation, that directories are not mapped to /mnt/lifery/deploy and /mnt/liferay/scripts.

Nothing happens if I put something inside my deploy host folder and a little bash script I put inside scripts is not copied inside the container at startup, nor launched at any step of container boot.

Any suggestions? Thank you!