Hi!
I made docker:
Dockerfile:
FROM ruby:2.7
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
COPY Gemfile Gemfile.lock ./
RUN gem install bundler
RUN bundle install
COPY ./ ./
RUN chmod +x docker-entrypoint.sh
CMD [“./docker-entrypoint.sh”]
docker-entrypoint.sh
#!/bin/sh
echo 'date.local upload script started at: ’ ( date ‘+%F %H:%M:%S’ ) ruby /usr/local/bundle/gems/ckan_cli-1.0.2/exe/cli.rb upload -d http://date.local/register.csv -c conf.json -r res.json -w echo 'date.local upload script ended at: ’ ( date ‘+%F %H:%M:%S’ )
exit 0;
If I start ./docker-entrypoint.sh to do manually in docher bash or from dockerd docker exec -it date.local ./docker-entrypoint.sh script work well. But I need to made crontab job, and one time in day execute this script. I install cron. I made crontab job:
20 22 * * * /usr/src/app/docker-entrypoint.sh >> /var/log/date.local/ date +\%Y\%m\%d
-date.local.log 2>&1
But I get the error:
/usr/src/app/docker-entrypoint.sh: 4: /usr/src/app/docker-entrypoint.sh: ruby: not found
I finded more advice internet, But they not work
How resolve it?