Fix wrong user config
This commit is contained in:
parent
5538470a5d
commit
788e59dad0
@ -6,7 +6,5 @@ RUN apt-get update \
|
||||
&& apt-get -y install cron \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN useradd test
|
||||
|
||||
# Run the command on container startup
|
||||
CMD crontab -u test /home/test/cron/crontab-file && cron -f
|
||||
CMD crontab /root/cron/crontab-file && cron -f
|
||||
|
@ -1 +1 @@
|
||||
* * * * * bash /test/cron/task.sh
|
||||
* * * * * bash /root/cron/task.sh
|
||||
|
@ -4,5 +4,5 @@ services:
|
||||
build: .
|
||||
volumes:
|
||||
- ./output:/output
|
||||
- ./:/home/test/cron
|
||||
- ./:/root/cron
|
||||
|
@ -17,3 +17,4 @@ Hello World at Thu Nov 30 22:07:01 UTC 2023
|
||||
Hello World at at at at at Thu Nov 30 22:08:01 UTC 2023
|
||||
Hello World at at at at at Thu Nov 30 22:09:01 UTC 2023: /root
|
||||
Hello World at at at at at Thu Nov 30 22:10:01 UTC 2023: /root
|
||||
Hello World at at at at at Fri Dec 1 21:51:01 UTC 2023: /root
|
||||
|
Loading…
Reference in New Issue
Block a user