Home >Backend Development >Golang >Docker: Why Am I Getting 'Permission Denied' When Running My Container?
Docker: Error Creating Shim Task - Permission Denied
When attempting to build and run a Docker container, you might encounter the error "docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./deployment-service": permission denied: unknown." This error occurs due to insufficient permissions to execute the ./deployment-service executable within the container.
Solution:
To resolve this issue, add the following line to your Dockerfile before the CMD ["./deployment-service"]:
RUN chmod +x deployment-service
This command will grant execution permissions to the ./deployment-service executable, allowing the container to run successfully. Here's the updated portion of your Dockerfile:
... # ... Code before this line ... RUN chmod +x deployment-service CMD ["./deployment-service"]
After adding this line, rebuild and re-run your Docker container. You should no longer encounter the permission denied error.
The above is the detailed content of Docker: Why Am I Getting 'Permission Denied' When Running My Container?. For more information, please follow other related articles on the PHP Chinese website!