I am building a Rails application on Ubuntu 18.04 and I trying to set up the deployment of the application using docker.
I have 2 entrypoint files:
- docker/entrypoints/docker-entrypoint.sh
- docker/entrypoints/sidekiq-entrypoint.sh
Usually, to make the files executable, I have to run the commands below in my host machine terminal:
chmod +x docker/entrypoints/docker-entrypoint.sh
chmod +x docker/entrypoints/sidekiq-entrypoint.sh
However, I would like to make this possible in the Dockerfile, without having to always do it on the host machine's terminal.
For this, I added the command below in the Dockerfile:
RUN chmod +x docker/entrypoints/docker-entrypoint.sh \
chmod +x docker/entrypoints/sidekiq-entrypoint.sh
ENTRYPOINT ["./docker/entrypoints/docker-entrypoint.sh"]
But then I run into this error:
chmod: cannot access 'chmod': No such file or directory
chmod: cannot access '+x': No such file or directory
ERROR: Service 'app' failed to build: The command '/bin/sh -c chmod +x docker/entrypoints/docker-entrypoint.sh chmod +x docker/entrypoints/sidekiq-entrypoint.sh' returned a non-zero code: 1
I have tried a few solutions, but none has worked so far. Any form of help would be gladly appreciated.