Docker File: Chmod on Entrypoint Script
docker, dockerfile
Solution
Docker will copy files into the container with the permissions of their source. If you strip the Linux executable bits somewhere in the chain of pushing to your code repo, or on your build host, then you'll need to add those execute permissions back. I've seen this issue most often reported by Windows users, who are downloading code to a filesystem that doesn't support the Linux permission bits. Hopefully we'll get a `COPY --chmod` solution soon that will eliminate the need for an extra layer.
Problem
Is there a reason I need to chmod +x on my entrypoint script? It didn't appear Redis was doing this in their dockerfile (https://github.com/docker-library/redis/blob/109323988b7663bceaf4a01c3353f8934dfc002e/2.8/Dockerfile) for their entrypoint script. Dockerfile: ``` # Generic Docker Image for Running Node app from Git Repository FROM node:0.10.33-slim ENV NODE_ENV production # Add script to pull Node app from Git and run the app COPY docker-node-entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] EXPOSE 8080 CMD ["--help"] ```