-
Notifications
You must be signed in to change notification settings - Fork 45
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
No output using this example #1
Comments
@SagarKevin seems like you are missing something at your end? as its not expected behavior. |
@adiii717 thanks for your reply. Below is the log from the console. I followed all the steps mentioned and used the exact code and naming convention you used. I let it it run for a few minutes, but still no output. Not sure what the issue is here. is there a way I can troubleshoot this? |
@adiii717 same here, as @SagarKevin reported. |
@gekakud which os you are using and docker version please |
@SagarKevin one way to check container logs
|
Hello guys, I find the fix to the problem of this repo, You have to replace the crontab by: #run python script every minutes
And thanks to Adii for the repo |
@barcalalor : This does not fix the issue for me :-(. Any further suggestions? |
Hi, I cloned this repo to try this example. looks like the cron works but the pyhton command does not work. Build:
Run:
Docker version:
|
Same here |
For the issue with
|
I've got it working by modifying the crontab:
and add this to the Dockerfile (before the CMD):
|
Ah right, the "LF" method didn't work for me 😢. I figure it must be something to do with the cron job as when I copy paste my python command from my crontab file to the docker terminal that seems to execute fine and even output to the right logs. Anyone else manage to get this one working? |
My issue was resolved and the cron began working by switching from FROM python:3.10
RUN apt-get update && apt-get -y install cron vim
WORKDIR /services/app
COPY ../finsec ./finsec
COPY ../../requirements.txt requirements.txt
COPY /services/app .
COPY /services/app/crontab /etc/cron.d/crontab
RUN pip install -r requirements.txt
RUN chmod 0644 /etc/cron.d/crontab
RUN crontab /etc/cron.d/crontab
CMD ["cron", "-f"] * * * * * python3 /services/app/main.py > /proc/1/fd/1
|
@git-shogg Thanks for the tip pertaining to the slim image. I switched to the normal image, but then I encountered the following fix and I found out it doesn't matter if I use the slim image or not. I'm using So the actual problem in my case was that So in the crontab I now use the user's local python and it works.
|
Thanks @elburro1887, I'll check out your approach! |
Hi,
Thank you very much for this example. I used the exact same files and code, but there was no output generated. Would you happen to know why that is the case?
Thanks1
The text was updated successfully, but these errors were encountered: