I'm new to docker and I'm having problem creating a symbolic link with the following RUN command:
FROM php:7.3-apache
RUN ["/bin/bash", "-c", "ln -s /app/frontend/web/* /var/www/html"] && \
ln -s /app/backend/web /var/www/html/admin
Here is the output when doing "ls -la /var/www/html" inside the container:
'*' -> '/app/frontend/web/*'
admin -> /app/backend/web
I'm expecting the following output:
css -> /app/frontend/web/css
index.php -> /app/frontend/web/index.php
admin -> /app/backend/web
I'm getting the correct output when creating the symlink directly in the container but for some reason the wildcard (*) does not work when building the image.
If I'm replacing the wildcard by a specific file, the symlink is creating correctly at build time. This is working but I'd like to avoid listing every files from the folder:
FROM php:7.3-apache
RUN ["/bin/bash", "-c", "ln -s /app/frontend/web/index.php /var/www/html"]
Anyone have a clue on how to do that, I've been searching for a while now and tried different syntax of that RUN command with no success.
EDIT: The symbolic link to my backend works as expected. I also should have noted that I'm using docker-compose and a volume containing my webapp is mounted to the /app folder.
Thanks