I am trying to run docker compose up
an exisiting successfully built project (by docker-compose build
), namely DeathStarBench (can be found in this Github repository).When running docker compose up
get the following error:
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./cmd/geo": is a directory: unknown: permission denied
Each time the name of the failed service can change (here is geo
service).
The following code shows the content of Dockerfile:
FROM golang:1.21 as builderWORKDIR /workspaceCOPY go.sum go.sumCOPY go.mod go.modCOPY vendor/ vendor/COPY cmd/ cmd/COPY dialer/ dialer/COPY registry/ registry/COPY services/ services/COPY tls/ tls/COPY tracing/ tracing/COPY tune/ tune/COPY config.json config.jsonRUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go install -ldflags="-s -w" -mod=vendor ./cmd/...
For each service listed in cmd
folder, the entry point in docker-compose.yaml
file has been set to: entrypoint: ./cmd/<name of the service>
, .e.g., for geo
service it is entrypoint: ./cmd/geo
. It seems that the entry points are correct here.
The running platform is Ubuntu 22.04
and Docker version 26.1.1, build 4cf5afa
.Note that services are all in Golang.
To resolve the problem I have tried the following ways, but get the same error.
Unsuccessful Trials
1. Give full permission to all services in ./cmd
(from this post in Stackoverflow)
Like the following change:
# <remaining code in Dockerfile>USER rootRUN chmod -R 777 ./cmd/*RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go install -ldflags="-s -w" -mod=vendor ./cmd/...RUN chmod -R 777 ./cmd/*
Maybe part of the changes was enough, but the whole set of chnages was not successul, including USER root
or changing permissions before and after RUN
command (it should be after COPY by the way that it is).
2. Running the command with sudo
:
After applying the changes mentioned in trial #1, run the docker compose up
using sudo
command. Yet, the same problem exists.
3. Add current user to the docker group (as suggested in this post)
After adding the current user to a docker group, I get the same error again (I have also rebooted the system after adding the user to the group).
4. Changed permission of docker sockets (as suggested in this post)
Change the permission of the docker sockets using the following command before running the docker compose up
:
sudo chmod 666 /var/run/docker.sock
Question
Now the question is how to approach to resolve the problem. Is there any problem with running the trials?