Ruby in docker container, I have a problem executing script by crontab

I made docker:
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

CMD ["./"]


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 ./ to do manually in docher bash or from dockerd docker exec -it date.local ./ 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/ >> /var/log/date.local/ date +\%Y\%m\%d -date.local.log 2>&1

But I get the error:
/usr/src/app/ 4: /usr/src/app/ ruby: not found

I finded more advice internet, But they not work :frowning:
How resolve it?'s formatting is broken so it’s a little hard to read - but in cron, the full path of the executable needs to be used.

I redoing docker to docker-compose. And vualla, it worked good.
As next I redoind to K8s.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs