Answer the question
In order to leave comments, you need to log in
How to fix docker: Error response from daemon: oci runtime error: container_linux.go issue?
Hello! Help fix the problem.
There is the following Dockerfile :
FROM golang:1.11
RUN mkdir /app
WORKDIR /app
ADD . $SRC_DIR
EXPOSE 8000
ENTRYPOINT ["./service"]
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"./service\": permission denied".
sudo docker run --name service_container -d -p 8000:8000 service_image
sudo chmod 775 service
Answer the question
In order to leave comments, you need to log in
Perhaps the rights were not transferred when adding the file to the container, try adding after adding the files:
But I do not quite understand why the golang:1.11 image is needed in this case, if ./service is already a compiled binary file.
If so, you can lighten the image by using scratch or alpine as the base image:
FROM alpine
ADD ./service /
RUN chmod +x /service
EXPOSE 8000
ENTRYPOINT ["./service"]
The FROM GOLANG image is only needed for compilation, not for execution.
You carry the excess with you.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question