Code Monkey home page Code Monkey logo

Comments (7)

tomsik68 avatar tomsik68 commented on August 10, 2024 1

Also if I want to run a full fledged web application, should I do an FTP from my localhost to the /opt/lampp/htdocs/www directory ? creating all the files manually here is also very tedious and time consuming. Hope you get my point. Ideally if I have the PHP web app inside the my_web_pages directory, it should be mapped under the www under the /opt/lampp/htdocs/www as per the Dockerfile. I dont see a relevant entry in the Dockerfile as well and hence I posted this issue here for your help.

I agree with your point and Docker allows you to run your webpage without having to copy files to the container. It should suffice to mount the directory with your php files -- ~/my_web_pages in my examples.

If the command you used to start the container has the -v flag, your php files should already be available in the container. If not, you might need to change preferences for your folder sharing in Docker for Mac: https://docs.docker.com/desktop/settings/mac/#file-sharing

Also, I regret to inform you that building your own image of docker-xampp won't help you resolve this.

from docker-xampp.

itsraghz avatar itsraghz commented on August 10, 2024 1

Hey, thanks.Let me try the option you suggested of using -v flag, and also by exploring the docker setup for the file sharing in Mac.

from docker-xampp.

tomsik68 avatar tomsik68 commented on August 10, 2024

Hi, thank you for the report! Can you try browsing to http://localhost:41062/www ?

To be precise, -v ~/my_web_pages:/www does not copy the files. Rather, the files become accessible for the container. If the container modifies the files, it modifies the original files -- there's no copy involved.

from docker-xampp.

itsraghz avatar itsraghz commented on August 10, 2024

Hi @tomsik68 ,thank you. I see that the default index.php page appears/renders when I access the URL http://localhost:41062/www . Just to be more precise and explicit, I have my own index.php file inside the my_web_pages directory (in the current directrory where I have the Dockerfile - which should be mapped under /www directory of the Server being created. Right? It takes its own index.php and not mine. That is my concern. However I could get into the bash via this Command docker exec -ti myXampp bash and edit the index.php through this command vi /opt/lampp/htdocs/www/index.php. But this is no what I want.

Also if I want to run a full fledged web application, should I do an FTP from my localhost to the /opt/lampp/htdocs/www directory ? creating all the files manually here is also very tedious and time consuming. Hope you get my point. Ideally if I have the PHP web app inside the my_web_pages directory, it should be mapped under the www under the /opt/lampp/htdocs/www as per the Dockerfile. I dont see a relevant entry in the Dockerfile as well and hence I posted this issue here for your help.

from docker-xampp.

itsraghz avatar itsraghz commented on August 10, 2024

I tried building a fresh build from the Dockerfile using the command docker build - < Dockerfile but it gives me the following error.

➜  xampp docker build - < Dockerfile
[+] Building 2.4s (11/12)                                                                                                    
 => [internal] load build definition from Dockerfile                                                                    0.0s
 => => transferring dockerfile: 2.20kB                                                                                  0.0s
 => [internal] load .dockerignore                                                                                       0.0s
 => => transferring context: 2B                                                                                         0.0s
 => [internal] load metadata for docker.io/library/debian:buster                                                        2.3s
 => [auth] library/debian:pull token for registry-1.docker.io                                                           0.0s
 => CANCELED [1/7] FROM docker.io/library/debian:buster@sha256:2d356e1e22c0902f88ef65cb7159ecd5a96feb62345747edfd4324b  0.0s
 => => resolve docker.io/library/debian:buster@sha256:2d356e1e22c0902f88ef65cb7159ecd5a96feb62345747edfd4324b0d83a2923  0.0s
 => => sha256:2d356e1e22c0902f88ef65cb7159ecd5a96feb62345747edfd4324b0d83a2923 984B / 984B                              0.0s
 => [internal] load build context                                                                                       0.0s
 => => transferring context: 2B                                                                                         0.0s
 => CACHED [2/7] RUN echo 'root:root' | chpasswd                                                                        0.0s
 => CACHED [3/7] RUN apt-get update --fix-missing &&   apt-get upgrade -y &&   apt-get -y install curl net-tools &&     0.0s
 => CACHED [4/7] RUN curl -Lo xampp-linux-installer.run "https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.  0.0s
 => ERROR [5/7] COPY supervisord-openssh-server.conf /etc/supervisor/conf.d/supervisord-openssh-server.conf             0.0s
 => ERROR [6/7] COPY startup.sh /startup.sh                                                                             0.0s
------
 > [5/7] COPY supervisord-openssh-server.conf /etc/supervisor/conf.d/supervisord-openssh-server.conf:
------
------
 > [6/7] COPY startup.sh /startup.sh:
------
failed to compute cache key: "/startup.sh" not found: not found

I do have the startup.sh file from the github repository along side the supervisord-openssh-server.conf file. But it is saying that the startup.sh is not available.

from docker-xampp.

itsraghz avatar itsraghz commented on August 10, 2024

I tried building the docker image with two different version of the command as follows.

  • docker build .
  • docker build -f Dockerfile .

Luckily it had proceeded further but gave a different error as follows.

➜  xampp docker build -f Dockerfile .
[+] Building 281.3s (8/11)                                                                                                   
 => [internal] load build definition from Dockerfile                                                                    0.0s
 => => transferring dockerfile: 37B                                                                                     0.0s
 => [internal] load .dockerignore                                                                                       0.0s
 => => transferring context: 2B                                                                                         0.0s
 => [internal] load metadata for docker.io/library/debian:buster                                                        1.1s
 => [1/7] FROM docker.io/library/debian:buster@sha256:2d356e1e22c0902f88ef65cb7159ecd5a96feb62345747edfd4324b0d83a2923  0.0s
 => [internal] load build context                                                                                       0.0s
 => => transferring context: 173B                                                                                       0.0s
 => CACHED [2/7] RUN echo 'root:root' | chpasswd                                                                        0.0s
 => CACHED [3/7] RUN apt-get update --fix-missing &&   apt-get upgrade -y &&   apt-get -y install curl net-tools &&     0.0s
 => ERROR [4/7] RUN curl -Lo xampp-linux-installer.run "https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5  280.1s
------                                                                                                                       
 > [4/7] RUN curl -Lo xampp-linux-installer.run "https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.14/xampp-linux-x64-5.6.14-4-installer.run?from_af=true" &&   chmod +x xampp-linux-installer.run &&   bash -c './xampp-linux-installer.run' &&   ln -sf /opt/lampp/lampp /usr/bin/lampp &&   sed -i.bak s'/Require local/Require all granted/g' /opt/lampp/etc/extra/httpd-xampp.conf &&   mkdir /opt/lampp/apache2/conf.d &&   echo "IncludeOptional /opt/lampp/apache2/conf.d/*.conf" >> /opt/lampp/etc/httpd.conf &&   mkdir /www &&   ln -s /www /opt/lampp/htdocs &&   mkdir -p /var/run/sshd &&   sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config:
#7 0.298   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
#7 0.298                                  Dload  Upload   Total   Spent    Left  Speed
100   816    0   816    0     0    133      0 --:--:--  0:00:06 --:--:--   169
100   806    0   806    0     0    112      0 --:--:--  0:00:07 --:--:-- 24424
100  1039    0  1039    0     0    139      0 --:--:--  0:00:07 --:--:-- 1014k
100   413  100   413    0     0     47      0  0:00:08  0:00:08 --:--:--  1240
100  129M  100  129M    0     0   472k      0  0:04:39  0:04:39 --:--:--  593k
------
executor failed running [/bin/sh -c curl -Lo xampp-linux-installer.run "https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.14/xampp-linux-x64-5.6.14-4-installer.run?from_af=true" &&   chmod +x xampp-linux-installer.run &&   bash -c './xampp-linux-installer.run' &&   ln -sf /opt/lampp/lampp /usr/bin/lampp &&   sed -i.bak s'/Require local/Require all granted/g' /opt/lampp/etc/extra/httpd-xampp.conf &&   mkdir /opt/lampp/apache2/conf.d &&   echo "IncludeOptional /opt/lampp/apache2/conf.d/*.conf" >> /opt/lampp/etc/httpd.conf &&   mkdir /www &&   ln -s /www /opt/lampp/htdocs &&   mkdir -p /var/run/sshd &&   sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config]: exit code: 127

from docker-xampp.

tomsik68 avatar tomsik68 commented on August 10, 2024

We just hit a one year anniversary after opening 🎉 I'm closing this for inactivity for now. I'd appreciate if you shared your solution if you ever solved this. Feel free to reopen the ticket if you have more questions.

from docker-xampp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.