Encountering 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" while attempting to build and run a Dockerfile can be frustrating. This issue arises due to insufficient permissions for executing the "deployment-service" binary.
To resolve this issue, you can modify your Dockerfile by adding the following line:
RUN chmod +x deployment-service
This line will grant executable permissions to the "deployment-service" binary, ensuring that it can be executed successfully within the container.
Once this line has been added, rebuild the Docker image using the following command:
docker build -t <new_image_name> .
Subsequently, run your container using the updated image with the following command:
docker run <options> <new_image_name>
By incorporating these changes, you should be able to successfully build, run, and execute the "deployment-service" binary within your Docker container.
The above is the detailed content of How to fix the 'Error response from daemon: failed to create shim task' in Docker?. For more information, please follow other related articles on the PHP Chinese website!