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

Rearding mysql directory ! #98

Closed
cyber-urvesh opened this issue Jun 27, 2020 · 7 comments
Closed

Rearding mysql directory ! #98

cyber-urvesh opened this issue Jun 27, 2020 · 7 comments

Comments

@cyber-urvesh
Copy link

Im am building the project using your Dockerfile. The issue is, initially MYSQL directory does not exists. After running the image, MYSQL directory is made and all the required files are installed. When a new database is created, it gets reflected in the MYSQL directory and works as charm.

ISSUE:
But when the project is pushed to Docker Hub and somebody pulls to use it, contents of MYSQL directory are not copied in /var/lib/mysql. Hence the web app doesn't work.

PS: I first upload the project on GitHub, then I tag the repository to Docker Hub and Docker Hub auto builds the docker using the Dockefile.

Please suggest me any solution for this.

@pzhlkj6612
Copy link
Contributor

Hi. Please see the "Persisting your MySQL" section in Readme.

@pzhlkj6612
Copy link
Contributor

OK, I got your point. Please see the discussions in Docker commit should retain container data in volumes too and Commit content of mounted volumes as well.

The commit operation will not include any data contained in volumes mounted inside the container.
from: https://docs.docker.com/engine/reference/commandline/commit/

IMO, maybe you should manually store and compress your data outside the container and send it to others.

@mattrayner
Copy link
Owner

Hi @karniv0re-cyber I have to agree with @pzhlkj6612 here, volumes are inherently external to the container so should be sent seperately

@smalldragoon
Copy link

HI, thanks @pzhlkj6612 for pointing me to this thread.
Idea on my side is that I have used "main" docker image to build a demo server, that I want now to share with other, as simple as possible, as the users are not technical at all ( running a docker will already be a challenge ;-) ).
So I would need a docker image with all content embeded ( ie : including the DB and the website files ).

@freakpants
Copy link

@smalldragoon If I understand you correctly, you want to deliver the same code and database everytime, and users won't be developing on this server? I think you could add the files in your Dockerfile when building the image, and not connect the respective directories as volumes when running the image. I think this is a bit antithetical to how docker works, and might not work at all, but you could try it.

@smalldragoon
Copy link

@freakpants yes, . I did this, removed the link to /app and installed my files and mysql in /var/www/html.
I know and agree that in is antiethical on how docker works, but it will save me hours of support and debugging :P

@freakpants
Copy link

hey, whatever works for you :) I'm not going to pretend my environment is always best practice :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants