-
Notifications
You must be signed in to change notification settings - Fork 97
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
Addressing some issues #100
base: master
Are you sure you want to change the base?
Conversation
Now there should be no issues with f.e. complex passwords and so on. I had problems with mine, because it has a lot of special characters...
Image size was very high, because of the build tools installed.
With this change it's possible to not remove install.php on container startup. This is usefull if there is no DB.
By the way, there is some strange behavior with mysql as you use it with docker-compose. After restart of the images mysql has some errors when an agent pushes information. He gets a http 500 in this case. Sometimes after a login in the dashboard, this issue was gone. With mariadb everything works great! |
I reverted back to solution without multi staged build, but use one RUN now. |
I can confirm that this works fine, no issues so far when using it in lieu of the published image. |
Hi, since you're editing the Dockerfile can you apt-get install cron to also address #97? Thanks, |
@tom-ph Yes i will do so. But i don't think, this is enough to activate cron for ocsinventory correctly. As far as i can see, the admin have to manually set the cronjobs in the container. Even if cron is installed. Every time a new image is used for the container, the cronjob is gone. So sth. in the entrypoint of the container with new parameters would be better i think. EDIT: You also cannot edit crontab, if there is no editor like nano or vim... |
this addresses OCSInventory-NG#97
Thanks! |
Another idea that orients on the ocs documentation came in my mind. Will push it tomorrow, if i have time for that. :) |
@tom-ph have you read https://wiki.ocsinventory-ng.org/13.Docker-documentation/Using-the-docker-image/#crontab-implementation ? Implementing cron in the container seems unnecessary. You can just use cron on the server, where docker is running, and "docker exec" the cron scripts inside the container. |
Actually I didn't, but I don't like it for a number of reasons. I think that the minimum requirement should be having cron inside the container to give the flexibility to implement the crontabs based on each one's requirements. The ideal solution would be to give the possibility to activate each of the cronjobs described here: |
Good point @tom-ph ! I have been thinking of another solution and would like to hear your opinion. To ensure admins can set up the cronjobs exactly as they need, I would provide the ability to use a cron file. This file can be included as volume in /etc/cron/docker-crontab. If the file exists, the entrypoint script runs |
I think this could be a great solution. If well documented, it could be an easy way to setup crontab with all the needed flexibility. |
Hey, let me know if I can help! |
Hey, you can test it of course. I've build a new image here: https://hub.docker.com/r/dorpauli/ocsinventory-docker-image Of course, the documentation will need to be updated if my changes are used. At this point I would like to help the developers. They just have to give me the hint where to write down what. |
any news about this pull request being merge ? |
Must read before submitting
Please, take a look to our contributing guidelines before submitting your pull request.
There's some simple rules that will help us to speed up the review process and avoid any misunderstanding
Contributors GuideLines
Status
READY
Description
In our organization we like to use OCS-Inventory with docker. So we tested a lot and encounter some things that could be improved. Internally we now build our own image, but i want to share the main things we invented. First of all we changed the sed commands in the entrypoints with perl, so that complex passwords with special characters are no problem anymore.
Secondly we implemented the opportunity to use the install.php script in the image, if it is necessary.
The last thing is, that we shrink the size of the image while using docker multistage build. Now the image is around 327 MB. Before the change it was 547 MB. The trick is to not have build-essential in one of the image layers.
I hope you can make use of it and that the addressed issues can be solved with that PR. Please comment if you have questions and sth. is unclear.
Related Issues
#99
#98
#81
Todos
Test environment
I did some tests with it, but didn't use nginx.
General informations
Docker host's operating system : Debian 11 and Ubuntu 22.04 (testet both)
Mysql Server version : MariaDB 10.11
Docker informations
Docker compose version : 1.25.0
Docker version : 20.10.5
Deploy Notes
Notes regarding deployment the contained body of work. These should note any dependencies changes,
logical changes, etc.
Impacted Areas in Application
List general components of the application that this PR will affect: