kubernetes-up-and-running / kuard

Demo app for Kubernetes Up and Running book
Apache License 2.0
1.56k stars 535 forks source link

permission denied issue #11

Closed bshetti closed 6 years ago

bshetti commented 6 years ago

I am following the kubernetes up and running book. I created the following:

FROM alpine MAINTAINER Kelsey Hightower kelsey.hightower@kuar.io COPY bin/kuard /kuard ENTRYPOINT ["/kuard"]

Ran: docker build -t kuard-amd64:1 .

then ran this: docker run -d --name kuard \ --publish 8080:8080 \ gcr.io/kuar-demo/kuard-amd64:1

Error ubuntu@ip-172-31-17-121:~/kuard$ sudo docker run -d --name kuard --publish 8080:8080 kuard-amd64:1 63d568a095758b5638200f30b964e9a4919f044be9871281658f6a47b18e1202 docker: Error response from daemon: oci runtime error: container_linux.go:265: starting container process caused "exec: \"/kuard\": permission denied".

kapalal commented 6 years ago

Same issue here i've tried to change the permission on /kuard with a RUN chmod +x but i still get the permission denied error

jbeda commented 6 years ago

What version of docker are you using? What is the OS/architecture?

jackie-do commented 6 years ago

I got the same issue on ubuntu 16 docker: Error response from daemon: oci runtime error: container_linux.go:265: starting container process caused "exec: \"/kuard\": permission denied".

docker version

Client: Version: 17.09.0-ce API version: 1.32 Go version: go1.8.3 Git commit: afdb6d4 Built: Tue Sep 26 22:42:18 2017 OS/Arch: linux/amd64

Server: Version: 17.09.0-ce API version: 1.32 (minimum version 1.12) Go version: go1.8.3 Git commit: afdb6d4 Built: Tue Sep 26 22:40:56 2017 OS/Arch: linux/amd64 Experimental: false

stmcginnis commented 6 years ago

Sounds like you haven't added your user to the docker group to have non-root permissions. Make sure you've run:

sudo usermod -aG docker $USER

Then log out and back in again. You can test this is working right before attempting the examples from the book by running:

docker run hello-world

And making sure that is working right first.

jackie-do commented 6 years ago

@stmcginnis thank for your comment. I still got the error after applying your advice. I have no issues when working with other images of my personal projects.

jbeda commented 6 years ago

Hi all -- I updated the README with some steps that work for me -- https://github.com/kubernetes-up-and-running/kuard#manual-docker-build.

Can y'all try that out and let me know if it works? If it does I'll fix up the book for the next edition to make this more clear.

jackie-do commented 6 years ago

@jbeda Thank for your quickly support, after update the dockerfile with the new config, I got a new issue === Dockerfile === FROM alpine COPY bin/1/amd64/kuard /kuard ENTRYPOINT ["/kuard"]

=== Issue after run "docker build -t kuard-amd64:1 ." === Step 1/3 : FROM alpine latest: Pulling from library/alpine ff3a5c916c92: Pull complete Digest: sha256:7df6db5aa61ae9480f52f0b3a06a140ab98d427f86d8d5de0bedab9b8df6b1c0 Status: Downloaded newer image for alpine:latest ---> 3fd9065eaf02

Step 2/3 : COPY bin/1/amd64/kuard /kuard COPY failed: stat /var/lib/docker/tmp/docker-builder419379731/bin/1/amd64/kuard: no such file or directory

jbeda commented 6 years ago

@jackiedo91 Did you run make from the base directory? That is the one that should be creating the binary that we are looking to put in there.

jeffreyt commented 6 years ago

Just stumbled upon this thread but I'm also following along with the book and running the make file was the missing step for me. Thank you @jbeda !

jbeda commented 6 years ago

Great! I'll close this now. Other folks -- please file a new issue or reopen if you think things are still broken.