Создал простой Dockerfile:
FROM golang
EXPOSE 8080 80 443
# Set pwd to the go folder
WORKDIR ${GOPATH}
RUN apt-get update -y && \
apt-get install -y \
nano
RUN go get github.com/gorilla/mux && go get github.com/go-sql-driver/mysql
COPY ${PROJECT_PATH} /go/cms
RUN cd /go/cms && go build && chmod +x cms
EXPOSE 8080
CMD ["./cms"]
но получаю ошибку
ERROR: for b5ceea118913_cms_web_1 Cannot start service web: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"./cms\": permission denied": unknown
ERROR: for web Cannot start service web: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"./cms\": permission denied": unknown
Чего тут не хватает?
docker run -it cms_web sh -c "pwd && ls -al"
показывает:
total 10828
drwxr-xr-x 1 root root 4096 Feb 28 09:04 .
drwxrwxrwx 1 root root 4096 Feb 28 09:04 ..
-rw-rw-r-- 1 root root 35 Feb 26 16:24 .env
-rw-rw-r-- 1 root root 13 Feb 26 16:24 .env.example
drwxrwxrwx 8 root root 4096 Feb 28 08:06 .git
-rwxrwxrwx 1 root root 32 Feb 27 08:20 .gitignore
drwxrwxrwx 3 root root 4096 Feb 28 09:03 .idea
-rwxrwxrwx 1 root root 166 Feb 26 15:56 Database
-rwxrwxrwx 1 root root 330 Feb 28 09:03 Dockerfile
drwxrwxrwx 7 root root 4096 Feb 27 15:04 _local_mysql_data
drwxrwxrwx 6 root root 4096 Feb 26 12:52 app
-rwsrws--T 1 root root 11025893 Feb 28 09:04 cms
-rwxrwxrwx 1 root root 940 Feb 27 08:38 docker-compose.yml
-rw-rw-r-- 1 root root 384 Feb 26 16:29 main.go
drwxrwxrwx 2 root root 4096 Feb 28 08:13 migrations
drwxrwxrwx 3 root root 4096 Feb 20 08:26 templates
.
, скажем. сколько раз я натыкался на такие проблемы были связаны с путями или volumes,