Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbolic Link for Module Not Applied in Docker Project #1297

Open
Ylmzef opened this issue Feb 19, 2025 · 1 comment
Open

Symbolic Link for Module Not Applied in Docker Project #1297

Ylmzef opened this issue Feb 19, 2025 · 1 comment
Labels

Comments

@Ylmzef
Copy link

Ylmzef commented Feb 19, 2025

Description:
I created a symbolic link for my Magento module under src/app/code, but it is not being recognized within the Docker environment. The module does not appear in Magento, and running bin/magento setup:upgrade does not detect it.

Steps to Reproduce:

  1. Inside src/app/code, create a symbolic link to the module:
    ln -s /path/to/my/module src/app/code/Vendor/Module
  2. Start the Docker environment:
    bin/start
  3. Run bin/magento setup:upgrade inside the container.

Expected Behavior:
The module should be detected and applied in the Magento instance.

Actual Behavior:
The module is not recognized, and Magento does not detect the symbolic link.

Environment Details:

  • Host OS: macOS 15.3.1
  • Docker version: 4.38.0

Additional Notes:

  • Running ls -l src/app/code/Vendor on the host shows the symbolic link correctly.
  • Inside the container, the symlink appears as a regular file instead of pointing to the actual module.
  • Possible issue with Docker volume mounts not preserving symbolic links?

Is there a recommended way to work with symbolic links inside this Docker setup? Any guidance would be appreciated!

Copy link

dosubot bot commented Feb 19, 2025

Hello @Ylmzef! I'm here to help you with your Docker project. I can assist you in solving bugs, answering questions, and becoming a contributor.

The issue you're experiencing with symbolic links not being recognized inside the Docker container is likely due to how Docker handles volume mounts. By default, Docker does not preserve symbolic links when mounting volumes, which can cause the symlink to appear as a regular file inside the container.

To work around this, you can try the following approaches:

  1. Bind Mounts: Instead of using a symbolic link, you can directly mount the module directory into the container using a bind mount. This can be done by modifying your docker-compose.yml file to include a specific volume mount for your module. For example:

    volumes:
      - /path/to/my/module:/var/www/html/src/app/code/Vendor/Module

    This will ensure that the module directory is directly accessible inside the container.

  2. Copy the Module: As an alternative, you can copy the module directly into the src/app/code directory within the container. This can be done manually or by using a script during the container's startup process.

  3. Use Docker's COPY Command: If you are building a custom Docker image, you can use the COPY command in your Dockerfile to include the module in the image itself.

These methods should help you ensure that your Magento module is recognized within the Docker environment.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot dosubot bot added the bug label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant